new Attitude()
Attitude type.
Provides yaw, pitch, and roll attitude rotations.
Uses a quaternion and an orthogonal 3x3 matrix under the hood.
Extends
Members
cross
The cross Vector.
look
The look Vector
orientation
A quaternion representing the orientation of this Attitude.
up
The up Vector.
Methods
(static) toMatrix(attitude, matrixopt) → {Matrix}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
attitude |
Attitude | The Attitude. | |
matrix |
Matrix |
<optional> |
the Matrix to be set as a rotation-matrix representation of attitude. If undefined, creates a new Matrix. |
Throws:
-
if matrix argument is not a 3x3 Matrix, a 4x4 Matrix, or undefined.
- Type
- DimensionError
Returns:
- The matrix.
- Type
- Matrix
equals(array) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
array |
Array | The array to compare this Dimensional to. |
- Inherited From:
- Source:
Returns:
True if all entries are equal, false otherwise.
- Type
- boolean
pitch(theta) → {Attitude}
Rotates this Attitude around its cross axis by theta.
Parameters:
Name | Type | Description |
---|---|---|
theta |
number | The angle of rotation. |
Returns:
This Attitude.
- Type
- Attitude
roll(theta) → {Attitude}
Rotates this Attitude around its look axis by theta.
Parameters:
Name | Type | Description |
---|---|---|
theta |
number | The angle of rotation. |
Returns:
This Attitude.
- Type
- Attitude
rotate(matrix) → {matrix}
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Matrix | The Matrix to rotate by this Attitude |
Throws:
-
if matrix argument is undefined.
- Type
- ReferenceError
Returns:
The matrix.
- Type
- matrix
toMatrix(matrix) → {Matrix}
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Matrix | The Matrix to set as a rotation-matrix representation of this Attitude. |
Throws:
-
-
if matrix argument is undefined.
- Type
- ReferenceError
-
-
-
if matrix argument is not a 3x3 Matrix or a 4x4 Matrix.
- Type
- DimensionError
-
Returns:
The Matrix.
- Type
- Matrix
toString() → {string}
Returns:
A string representation of this Attitude.
- Type
- string
yaw(theta) → {Attitude}
Rotates this Attitude around its up axis by theta.
Parameters:
Name | Type | Description |
---|---|---|
theta |
number | The angle or rotation. |
Returns:
This Attitude.
- Type
- Attitude