/
<functions, functions, functions!>
/*!
◆ VectorAdd()
String VectorAdd |
( |
vecA |
, |
|
|
vecB |
|
|
) |
| |
Use the VectorAdd function to add two vectors of up to three elements each to each other
- Parameters
-
vecA | A vector of up to three elements. |
vecB | A vector of up to three elements. |
- Returns
- Returns the result of vecA + vecB.
- See also
- vectorSub
◆ VectorCross()
String VectorCross |
( |
vecA |
, |
|
|
vecB |
|
|
) |
| |
Use the VectorCross function to calculate the cross product of two vectors of up to three elements each. Remember, the resultant vector will always be an right angles (orthogonal) to both input vectors.
- Parameters
-
vecA | A vector of up to three elements. |
vecB | A vector of up to three elements. |
- Returns
- Returns the result of vecA x vecB.
- See also
- VectorDot
◆ VectorDist()
Float VectorDist |
( |
vecA |
, |
|
|
vecB |
|
|
) |
| |
Use the VectorDist function to calculate distance between two vectors of up to three elements each.
- Parameters
-
vecA | A vector of up to three elements. |
vecB | A vector of up to three elements. |
- Returns
- Returns the result of \ |Xa - Xb| |Ya - Yb| |Za - Zb| .
- See also
- VectorLen
◆ VectorDot()
Float VectorDot |
( |
vecA |
, |
|
|
vecB |
|
|
) |
| |
Use the VectorCross function to calculate the dot product of two unit vectors of up to three elements each. Warning! Be sure to always normalize both vecA and vecB before attempting to find the dot product. Calculating a dot product using un-normalized vectors (non- unit vectors) will result in meaningless results. If the return value is < 0, the inner-angle between the vectors is > 90 degrees. If the return value is == 0, the inner-angle between the vectors is == 90 degrees. If the return value is > 0, the inner-angle between the vectors is < 90 degrees.
- Parameters
-
vecA | A unit-vector of up to three elements. |
vecB | A unit-vector of up to three elements. |
- Returns
- Returns a scalar value equal to the result of vecA . vecB. This value which will always be a single floating-point value in the range [ -1 , +1 ].
- See also
- VectorCross
◆ VectorLen()
Use the VectorLen function to calculate the length of vector vec.
- Parameters
-
vec | A vector of up to three elements. |
- Returns
- Returns a scalar representing the length of the vector vec.
- See also
- VectorDist
◆ VectorNormalize()
String VectorNormalize |
( |
vec |
| ) |
|
Use the VectorNormalize function to calculated the unit vector equivalent of the vector vec.
- Parameters
-
vec | A vector of up to three elements. |
- Returns
- Returns the unit vector equivalent of the vector vec.
- See also
- VectorScale
◆ VectorOrthoBasis()
String VectorOrthoBasis |
( |
vec |
| ) |
|
Use the VectorOrthoBasis function to calculate a 3x3 Row-Major formated matrix representing the orthogonal basis for the vector vec.
- Parameters
-
vec | A four element vector of the form \AxisX AxisY AxisZ theta\, where theta is the angle of rotation about the vector formed by the prior three values. |
- Returns
- Returns a 3x3 Row-Major formated matrix
◆ VectorScale()
String VectorScale |
( |
vec |
, |
|
|
scale |
|
|
) |
| |
Use the VectorScale function to scale the vector vec by the scalar scale.
- Parameters
-
vec | A vector of up to three elements. |
scale | A numeric value (integer or floating-point) representing the scaling factor. |
- Returns
- Returns a scaled version of the vector vec, equivalent to: ( scale * X ) ( scale * Y ) ( scale * Z ).
- See also
- VectorNormalize
◆ VectorSub()
String VectorSub |
( |
vecA |
, |
|
|
vecB |
|
|
) |
| |
Use the VectorSub function to subtract vecB from vecA.
- Parameters
-
vecA | Left side vector in subtraction equation. |
vecB | Right side vector in subtraction equation. |
- Returns
- Returns a new vector equivalent to: \vecA - vecB.
- See also
- vectorAdd