Packageorg.flintparticles.threeD.geom
Classpublic class Point3D
InheritancePoint3D Inheritance org.flintparticles.threeD.geom.Transformable3D

Point3D represents a point in three-dimensional cartesian coordinate space.



Public Properties
 PropertyDefined by
  classType : Class
[read-only] Returns the actual type of the object - Point3D or Vector3D.
Point3D
Public Methods
 MethodDefined by
  
Point3D(x:Number = 0, y:Number = 0, z:Number = 0)
Constructor
Point3D
  
add(v:Vector3D, result:Point3D = null):Point3D
Adds a vector to this point, translating this point according to the vector, and returns the result.
Point3D
  
Copies another point into this one.
Point3D
  
clone(result:Point3D = null):Point3D
Makes a copy of this point.
Point3D
  
Subtract a vector from this point.
Point3D
  
distance(p:Point3D):Number
Calculates the distance between two points.
Point3D
  
Calculates the square of the distance between two points.
Point3D
  
divide(s:Number, result:Point3D = null):Point3D
Divide this point by a number, returning the result.
Point3D
  
divideBy(s:Number):Point3D
Divide this point by a number.
Point3D
  
equals(p:Point3D):Boolean
Compare this point to another.
Point3D
  
Add a vector to this point.
Point3D
  
multiply(s:Number, result:Point3D = null):Point3D
Multiply this point by a number, returning the result.
Point3D
  
nearTo(p:Point3D, e:Number):Boolean
Compare this point to another.
Point3D
  
Divide all the coordinates in this popoint by the w coordinate, producing a point with a w coordinate of 1.
Point3D
  
reset(x:Number = 0, y:Number = 0, z:Number = 0):Point3D
Assigns new coordinates to this point
Point3D
  
scaleBy(s:Number):Point3D
Multiply this point by a number.
Point3D
  
subtract(v:Vector3D, result:Point3D = null):Point3D
Subtract a vector from this point, returning the result.
Point3D
  
toString():String
Get a string representation of this point
Point3D
  
Point3D
  
vectorTo(p:Point3D, result:Vector3D = null):Vector3D
Create the vector from this point to another point.
Point3D
Public Constants
 ConstantDefined by
  ZERO : Point3D
[static] A zero point.
Point3D
Property detail
classTypeproperty
classType:Class  [read-only]

Returns the actual type of the object - Point3D or Vector3D. Used by some matrix operations.

Implementation
    public function get classType():Class
Constructor detail
Point3D()constructor
public function Point3D(x:Number = 0, y:Number = 0, z:Number = 0)

Constructor

Parameters
x:Number (default = 0) — the x coordinate of the point
 
y:Number (default = 0) — the y coordinate of the point
 
z:Number (default = 0) — the z coordinate of the point
Method detail
add()method
public function add(v:Vector3D, result:Point3D = null):Point3D

Adds a vector to this point, translating this point according to the vector, and returns the result.

Parameters
v:Vector3D — the vector to add
 
result:Point3D (default = null) — The point to hold the result of the addition. If no point is passed, a new point is created.

Returns
Point3D — the result of the addition
assign()method 
public function assign(p:Point3D):Point3D

Copies another point into this one.

Parameters
p:Point3D — The point to copy

Returns
Point3D — a reference to this point
clone()method 
public function clone(result:Point3D = null):Point3D

Makes a copy of this point.

Parameters
result:Point3D (default = null) — The point to hold the copy of this point. If no point is passed, a new point is created.

Returns
Point3D — A copy of this point
decrementBy()method 
public function decrementBy(v:Vector3D):Point3D

Subtract a vector from this point.

Parameters
v:Vector3D — The vector to subtract

Returns
Point3D — A reference to this point.
distance()method 
public function distance(p:Point3D):Number

Calculates the distance between two points.

Parameters
p:Point3D — the other point.

Returns
Number — the distance between the points.
distanceSquared()method 
public function distanceSquared(p:Point3D):Number

Calculates the square of the distance between two points. This is faster than calculating the actual distance.

Parameters
p:Point3D — the other point.

Returns
Number — the square of the distance between the points.
divide()method 
public function divide(s:Number, result:Point3D = null):Point3D

Divide this point by a number, returning the result.

Parameters
s:Number — The number to divide by
 
result:Point3D (default = null) — The point to hold the result of the divide. If no point is passed, a new point is created.

Returns
Point3D — The result of the division
divideBy()method 
public function divideBy(s:Number):Point3D

Divide this point by a number.

Parameters
s:Number — The number to divide by

Returns
Point3D — A reference to this point.
equals()method 
public function equals(p:Point3D):Boolean

Compare this point to another.

Parameters
p:Point3D — The point to compare with

Returns
Boolean — true if the points have the same coordinates, false otherwise
incrementBy()method 
public function incrementBy(v:Vector3D):Point3D

Add a vector to this point.

Parameters
v:Vector3D — The vector to add

Returns
Point3D — A reference to this point.
multiply()method 
public function multiply(s:Number, result:Point3D = null):Point3D

Multiply this point by a number, returning the result.

Parameters
s:Number — The number to multiply by
 
result:Point3D (default = null) — The point to hold the result of the multiply. If no point is passed, a new point is created.

Returns
Point3D — The result of the multiplication
nearTo()method 
public function nearTo(p:Point3D, e:Number):Boolean

Compare this point to another.

Parameters
p:Point3D — The point to compare with
 
e:Number — The distance allowed between the points.

Returns
Boolean — true if the points are within distance e of each other, false otherwise
project()method 
public function project():Point3D

Divide all the coordinates in this popoint by the w coordinate, producing a point with a w coordinate of 1.

Returns
Point3D — The projection of this point to a point with a w coordinate of 1.
reset()method 
public function reset(x:Number = 0, y:Number = 0, z:Number = 0):Point3D

Assigns new coordinates to this point

Parameters
x:Number (default = 0) — The new x coordinate
 
y:Number (default = 0) — The new y coordinate
 
z:Number (default = 0) — The new z coordinate

Returns
Point3D — a reference to this Point3D object
scaleBy()method 
public function scaleBy(s:Number):Point3D

Multiply this point by a number.

Parameters
s:Number — The number to multiply by

Returns
Point3D — A reference to this point.
subtract()method 
public function subtract(v:Vector3D, result:Point3D = null):Point3D

Subtract a vector from this point, returning the result.

Parameters
v:Vector3D — The vector to subtract
 
result:Point3D (default = null) — The point to hold the result of the subtraction. If no point is passed, a new point is created.

Returns
Point3D — The result of the subtraction
toString()method 
public function toString():String

Get a string representation of this point

Returns
String — a string representation of this point
toVector3D()method 
public function toVector3D(v:Vector3D = null):Vector3DParameters
v:Vector3D (default = null)

Returns
Vector3D
vectorTo()method 
public function vectorTo(p:Point3D, result:Vector3D = null):Vector3D

Create the vector from this point to another point.

Parameters
p:Point3D — The other point
 
result:Vector3D (default = null) — The vector to hold the result. If no vector is passed, a new vector is created.

Returns
Vector3D — The result of the subtraction
Constant detail
ZEROconstant
public static const ZERO:Point3D

A zero point.