Packagegraphics.geom
Classpublic class Vectors4
InheritanceVectors4 Inheritance Object

Static tool class to manipulate and transform Vector4 references.



Public Methods
 MethodDefined By
  
[static] Computes the addition of two Vector4 and returns the first vector.
Vectors4
  
[static] Returns the cross product of two Vector4.
Vectors4
  
[static] Computes the addition of two Vector4.
Vectors4
  
getAngle(v1:Vector4, v2:Vector4):Number
[static] Returns the angle in radian between the two 3D vectors.
Vectors4
  
[static] Computes the cross product of the two Vector4s.
Vectors4
  
getDot(v1:Vector4, v2:Vector4):Number
[static] Computes the dot product of the two Vector4s.
Vectors4
  
getLength(v:Vector4):Number
[static] Returns the length of the vector.
Vectors4
  
[static] Computes the oposite Vector4 of the Vector4.
Vectors4
  
getNorm(v:Vector4):Number
[static] Computes the norm of the Vector4.
Vectors4
  
getPow(v:Vector4, value:Number):Vector4
[static] Computes the power of the specified Vector4.
Vectors4
  
getScale(v:Vector4, value:Number):Vector4
[static] Scales the specified Vector4 with the input value.
Vectors4
  
[static] Returns the squared length of this vector.
Vectors4
  
[static] Computes the substraction of two Vector4.
Vectors4
  
normalize(v:Vector4):Boolean
[static] Normalize the specified Vector4 in parameter.
Vectors4
  
scale(v:Vector4, value:Number):void
[static] Scales the specified Vector4 with the input value.
Vectors4
  
[static] Sets the specified Vector4 object with the second Vector4 object passed in argument.
Vectors4
Method Detail
addition()method
public static function addition(v1:Vector4, v2:Vector4):Vector4

Computes the addition of two Vector4 and returns the first vector.

Parameters

v1:Vector4 — the first Vector4.
 
v2:Vector4 — the second Vector4.

Returns
Vector4 — the addition result of two Vector4.
cross()method 
public static function cross(v1:Vector4, v2:Vector4):Vector4

Returns the cross product of two Vector4. The returned Vector4 is orthogonal to the other two Vector4 and when ignoring the fourth component the resulting Vector3 is also orthogonal.

Parameters

v1:Vector4
 
v2:Vector4

Returns
Vector4
getAddition()method 
public static function getAddition(v1:Vector4, v2:Vector4):Vector4

Computes the addition of two Vector4.

Parameters

v1:Vector4 — a Vector4 to concat.
 
v2:Vector4 — a Vector4 to concat.

Returns
Vector4 — the addition result of two Vector4.
getAngle()method 
public static function getAngle(v1:Vector4, v2:Vector4):Number

Returns the angle in radian between the two 3D vectors. The formula used here is very simple. It comes from the definition of the dot product between two vectors.

Parameters

v1:Vector4 — Vector4 The first Vector4.
 
v2:Vector4 — Vector4 The second Vector4.

Returns
Number — the angle in radian between the two vectors.
getCross()method 
public static function getCross(v1:Vector4, v2:Vector4):Vector4

Computes the cross product of the two Vector4s.

Parameters

v1:Vector4 — a Vector4.
 
v2:Vector4 — a Vector4.

Returns
Vector4 — the Vector4 resulting of the cross product.
getDot()method 
public static function getDot(v1:Vector4, v2:Vector4):Number

Computes the dot product of the two Vector4s.

Parameters

v1:Vector4 — a Vector4.
 
v2:Vector4 — a Vector4.

Returns
Number — the dot product of the 2 Vector4.
getLength()method 
public static function getLength(v:Vector4):Number

Returns the length of the vector.

Parameters

v:Vector4 — the vector.

Returns
Number — the length of the vector.
getNegate()method 
public static function getNegate(v:Vector4):Vector4

Computes the oposite Vector4 of the Vector4.

Parameters

v:Vector4 — the Vector4 reference to negate.

Returns
Vector4 — a new negate Vector4 reference.
getNorm()method 
public static function getNorm(v:Vector4):Number

Computes the norm of the Vector4.

Parameters

v:Vector4 — a Vector4 reference.

Returns
Number — the norm of the specified Vector4.
getPow()method 
public static function getPow(v:Vector4, value:Number):Vector4

Computes the power of the specified Vector4.

Parameters

v:Vector4 — the Vector4 reference.
 
value:Number — the value of the pow..

Returns
Vector4 — A new Vector4 powered by the method.
getScale()method 
public static function getScale(v:Vector4, value:Number):Vector4

Scales the specified Vector4 with the input value.

Parameters

v:Vector4 — the Vector4 reference to transform.
 
value:Number — a real number to scale the current Vector4.

Returns
Vector4 — A new Vector4 scaled by the value passed in second argument in this method.
getSquaredLength()method 
public static function getSquaredLength(v:Vector4):Number

Returns the squared length of this vector.

Parameters

v:Vector4 — the vector.

Returns
Number — the squared length of this vector.
getSubstraction()method 
public static function getSubstraction(v1:Vector4, v2:Vector4):Vector4

Computes the substraction of two Vector4.

Parameters

v1:Vector4 — a Vector4 to substract.
 
v2:Vector4 — a Vector4 to substract.

Returns
Vector4 — the substraction result of two Vector4.
normalize()method 
public static function normalize(v:Vector4):Boolean

Normalize the specified Vector4 in parameter.

Parameters

v:Vector4 — a Vector4 reference.

Returns
Booleantrue of the normalize method is success else false for mistake.
scale()method 
public static function scale(v:Vector4, value:Number):void

Scales the specified Vector4 with the input value.

Parameters

v:Vector4 — the Vector4 reference to transform.
 
value:Number — a real number to scale the current Vector4.

setByVector4()method 
public static function setByVector4(v1:Vector4, v2:Vector4):Vector4

Sets the specified Vector4 object with the second Vector4 object passed in argument.

Parameters

v1:Vector4 — the first Vector4.
 
v2:Vector4 — the second Vector4.

Returns
Vector4 — the first Vector4 transformed.