Packageaway3d.core.math
Classpublic final class Number3D

A point in 3D space.

Public Properties
 PropertyDefined by
  BACKWARD : Number3D
[static] A 3d number object representing a relative direction backward.
Number3D
  DOWN : Number3D
[static] A 3d number object representing a relative direction down.
Number3D
  FORWARD : Number3D
[static] A 3d number object representing a relative direction forward.
Number3D
  LEFT : Number3D
[static] A 3d number object representing a relative direction left.
Number3D
  modulo : Number
[read-only] The modulo of the 3d number object.
Number3D
  modulo2 : Number
[read-only] The squared modulo of the 3d number object.
Number3D
  RIGHT : Number3D
[static] A 3d number object representing a relative direction right.
Number3D
  UP : Number3D
[static] A 3d number object representing a relative direction up.
Number3D
  x : Number
The horizontal coordinate of the 3d number object.
Number3D
  y : Number
The vertical coordinate of the 3d number object.
Number3D
  z : Number
The depth coordinate of the 3d number object.
Number3D
Public Methods
 MethodDefined by
  
Number3D
(x:Number = 0, y:Number = 0, z:Number = 0, n:Boolean = false)
Creates a new Number3D object.
Number3D
  
add(v:Number3D, w:Number3D):void
Fills the 3d number object with the result from an addition of two 3d numbers.
Number3D
  
Duplicates the 3d number's properties to another Number3D object
Number3D
  
Calculates a 3d number object representing the closest point on a given plane to a given 3d point.
Number3D
  
cross(v:Number3D, w:Number3D):void
Fills the 3d number object with the result from an cross product of two 3d numbers.
Number3D
  
distance(w:Number3D):Number
Calculates the distance from the 3d number object to the given 3d number.
Number3D
  
dot(w:Number3D):Number
Calculates the dot product of the 3d number object with the given 3d number.
Number3D
  
getAngle(w:Number3D = null):Number
Returns the angle in radians made between the 3d number obejct and the given 3d number.
Number3D
  
normalize(val:Number = 1):void
Normalises the 3d number object.
Number3D
  
rotate(v:Number3D, m:Matrix3D):void
Fills the 3d number object with the result of a 3d matrix rotation performed on a 3d number.
Number3D
  
scale(v:Number3D, s:Number):void
Fills the 3d number object with scaled values from the given 3d number.
Number3D
  
sub(v:Number3D, w:Number3D):void
Fills the 3d number object with the result from a subtraction of two 3d numbers.
Number3D
  
toString():String
Used to trace the values of a 3d number.
Number3D
  
Fills the 3d number object with the result of a 3d matrix tranformation performed on a 3d number.
Number3D
Property detail
BACKWARDproperty
public static var BACKWARD:Number3D

A 3d number object representing a relative direction backward.

DOWNproperty 
public static var DOWN:Number3D

A 3d number object representing a relative direction down.

FORWARDproperty 
public static var FORWARD:Number3D

A 3d number object representing a relative direction forward.

LEFTproperty 
public static var LEFT:Number3D

A 3d number object representing a relative direction left.

moduloproperty 
modulo:Number  [read-only]

The modulo of the 3d number object.

Implementation
    public function get modulo():Number
modulo2property 
modulo2:Number  [read-only]

The squared modulo of the 3d number object.

Implementation
    public function get modulo2():Number
RIGHTproperty 
public static var RIGHT:Number3D

A 3d number object representing a relative direction right.

UPproperty 
public static var UP:Number3D

A 3d number object representing a relative direction up.

xproperty 
public var x:Number

The horizontal coordinate of the 3d number object.

yproperty 
public var y:Number

The vertical coordinate of the 3d number object.

zproperty 
public var z:Number

The depth coordinate of the 3d number object.

Constructor detail
Number3D()constructor
public function Number3D(x:Number = 0, y:Number = 0, z:Number = 0, n:Boolean = false)Parameters
x:Number (default = 0) — [optional] A default value for the horizontal coordinate of the 3d number object. Defaults to 0.
 
y:Number (default = 0) — [optional] A default value for the vertical coordinate of the 3d number object. Defaults to 0.
 
z:Number (default = 0) — [optional] A default value for the depth coordinate of the 3d number object. Defaults to 0.
 
n:Boolean (default = false) — [optional] Determines of the resulting 3d number object should be normalised. Defaults to false.
####INIT####
Method detail
add()method
public function add(v:Number3D, w:Number3D):void

Fills the 3d number object with the result from an addition of two 3d numbers.

Parameters
v:Number3D — The first 3d number in the addition.
 
w:Number3D — The second 3d number in the addition.
clone()method 
public function clone():Number3D

Duplicates the 3d number's properties to another Number3D object

Returns
Number3D — The new 3d number instance with duplicated properties applied
closestPointOnPlane()method 
public function closestPointOnPlane(p:Number3D, k:Number3D, n:Number3D):Number3D

Calculates a 3d number object representing the closest point on a given plane to a given 3d point.

Parameters
p:Number3D — The 3d point used in teh calculation.
 
k:Number3D — The plane offset used in the calculation.
 
n:Number3D — The plane normal used in the calculation.

Returns
Number3D — The resulting 3d point.
cross()method 
public function cross(v:Number3D, w:Number3D):void

Fills the 3d number object with the result from an cross product of two 3d numbers.

Parameters
v:Number3D — The first 3d number in the cross product calculation.
 
w:Number3D — The second 3d number in the cross product calculation.
distance()method 
public function distance(w:Number3D):Number

Calculates the distance from the 3d number object to the given 3d number.

Parameters
w:Number3D — The 3d number object whose distance is calculated.

Returns
Number
dot()method 
public function dot(w:Number3D):Number

Calculates the dot product of the 3d number object with the given 3d number.

Parameters
w:Number3D — The 3d number object to use in the calculation.

Returns
Number — The dot product result.
getAngle()method 
public function getAngle(w:Number3D = null):Number

Returns the angle in radians made between the 3d number obejct and the given 3d number.

Parameters
w:Number3D (default = null) — [optional] The 3d number object to use in the calculation.

Returns
Number — An angle in radians representing the angle between the two 3d number objects.
normalize()method 
public function normalize(val:Number = 1):void

Normalises the 3d number object.

Parameters
val:Number (default = 1) — [optional] A normalisation coefficient representing the length of the resulting 3d number object. Defaults to 1.
rotate()method 
public function rotate(v:Number3D, m:Matrix3D):void

Fills the 3d number object with the result of a 3d matrix rotation performed on a 3d number.

Parameters
v:Number3D — 3d number object to use in the calculation.
 
m:Matrix3D — 3d matrix object representing the rotation.
scale()method 
public function scale(v:Number3D, s:Number):void

Fills the 3d number object with scaled values from the given 3d number.

Parameters
v:Number3D — The 3d number object used for the scaling calculation.
 
s:Number — The scaling value.
sub()method 
public function sub(v:Number3D, w:Number3D):void

Fills the 3d number object with the result from a subtraction of two 3d numbers.

Parameters
v:Number3D — The starting 3d number in the subtraction.
 
w:Number3D — The subtracting 3d number in the subtraction.
toString()method 
public function toString():String

Used to trace the values of a 3d number.

Returns
String — A string representation of the 3d number object.
transform()method 
public function transform(v:Number3D, m:Matrix3D):void

Fills the 3d number object with the result of a 3d matrix tranformation performed on a 3d number.

Parameters
v:Number3D — 3d number object to use in the calculation.
 
m:Matrix3D — 3d matrix object representing the tranformation.
Wiki link
Click to go to the wiki page for ####WIKI####

Code examples

Comments