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
  
clone(v:Number3D):void
Duplicates a Number3D's properties to this Number3D.
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
  
equals(v:Number3D):Boolean
Compares the 3d number to another and returns a boolean indicating whether they match or not.
Number3D
  
getAngle(w:Number3D = null):Number
Returns the angle in radians made between the 3d number obejct and the given 3d number.
Number3D
  
[static] Returns a 3d number object representing a point between the two 3d number parameters w and v.
Number3D
  
interpolate(w:Number3D, f:Number):void
Fills the 3d number object with values representing a point between the current and the 3d number specified in parameter v.
Number3D
  
Fill the 3d number object with the euler angles represented by the 3x3 matrix rotation.
Number3D
  
Fill the 3d number object with the scale values represented by the 3x3 matrix.
Number3D
  
normalize(val:Number = 1):void
Normalises the 3d number object.
Number3D
  
quaternion2euler(quarternion:Quaternion):void
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 Parameters
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(v:Number3D):void

Duplicates a Number3D's properties to this Number3D.

Parameters
v:Number3D — Number3D The Number3D whose properties will be cloned.
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.
equals()method 
public function equals(v:Number3D):Boolean

Compares the 3d number to another and returns a boolean indicating whether they match or not.

Parameters
v:Number3D — The 3d number to compare against.

Returns
Boolean — Boolean indicating match.
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.
getInterpolated()method 
public static function getInterpolated(w:Number3D, v:Number3D, f:Number):Number3D

Returns a 3d number object representing a point between the two 3d number parameters w and v. The f parameter defines the degree of interpolation between the two ednpoints, where 0 or 1 will return 3d number objects equal to v and w respectively.

Parameters
w:Number3D — The target point.
 
v:Number3D — The zero point.
 
f:Number — The level of interpolation where 0.0 will return a 3d number object equal to v, and 1.0 will return a 3d number object equal to w.

Returns
Number3D

See also

flash.geom.Point.interpolate()
interpolate()method 
public function interpolate(w:Number3D, f:Number):void

Fills the 3d number object with values representing a point between the current and the 3d number specified in parameter v. The f parameter defines the degree of interpolation between the two endpoints, where 0 represents the unmodified current values, and 1.0 those of the v parameter.

Parameters
w:Number3D — The target point.
 
f:Number — The level of interpolation between the current 3d number and the parameter v.

See also

flash.geom.Point.interpolate()
matrix2euler()method 
public function matrix2euler(m:Matrix3D):void

Fill the 3d number object with the euler angles represented by the 3x3 matrix rotation.

Parameters
m:Matrix3D — The 3d matrix object to use in the calculation.
matrix2scale()method 
public function matrix2scale(m:Matrix3D):void

Fill the 3d number object with the scale values represented by the 3x3 matrix.

Parameters
m:Matrix3D — The 3d matrix object to use in the calculation.
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.
quaternion2euler()method 
public function quaternion2euler(quarternion:Quaternion):void Parameters
quarternion:Quaternion
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 — The 3d number object to use in the calculation.
 
m:Matrix3D — The 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 — The 3d number object to use in the calculation.
 
m:Matrix3D — The 3d matrix object representing the tranformation.
Wiki link
Click to go to the wiki page for 'away3d.core.math.Number3D'

Code examples

Comments