o3djs.quaternions Module Reference
List of all members.
Detailed Description
A Module for quaternion math.
Source
o3djs/quaternions.js
Public Member Functions
|
(!o3djs.quaternions.Quaternion|number)
|
add(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
addQuaternionQuaternion(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
addQuaternionScalar(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
addScalarQuaternion(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
axisRotation(axis, angle)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
conjugate(q)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
copy(q)
|
o3djs.quaternions |
|
(!o3djs.quaternions.Quaternion|number)
|
div(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
divQuaternionQuaternion(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
divQuaternionScalar(q, k)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
divScalarQuaternion(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
inverse(q)
|
o3djs.quaternions |
|
number
|
length(a)
|
o3djs.quaternions |
|
number
|
lengthSquared(a)
|
o3djs.quaternions |
|
string
|
mathType(a)
|
o3djs.quaternions |
|
(!o3djs.quaternions.Quaternion|number)
|
mul(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
mulQuaternionQuaternion(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
mulQuaternionScalar(q, k)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
mulScalarQuaternion(k, q)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
negative(q)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
normalize(a)
|
o3djs.quaternions |
|
!o3djs.math.Matrix4
|
quaternionToRotation(q)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
rotationToQuaternion(m)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
rotationX(angle)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
rotationY(angle)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
rotationZ(angle)
|
o3djs.quaternions |
|
(!o3djs.quaternions.Quaternion|number)
|
sub(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
subQuaternionQuaternion(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
subQuaternionScalar(a, b)
|
o3djs.quaternions |
|
!o3djs.quaternions.Quaternion
|
subScalarQuaternion(a, b)
|
o3djs.quaternions |
Public Properties
Member Function Documentation
Adds a quaternion to a scalar.
- Parameters:
-
| a |
Operand Quaternion. |
| b |
Operand Scalar. |
- Returns:
-
!o3djs.quaternions.Quaternion.The sum of a and b.
Adds a scalar to a quaternion.
- Parameters:
-
| a |
Operand scalar. |
| b |
Operand quaternion. |
- Returns:
-
!o3djs.quaternions.Quaternion.The sum of a and b.
Creates a quaternion which rotates around the given axis by the given
angle.
- Parameters:
-
| axis |
The axis about which to rotate. |
| angle |
The angle by which to rotate (in radians). |
- Returns:
-
!o3djs.quaternions.Quaternion.A quaternion which rotates angle
radians around the axis.
Divides two objects which are either scalars or quaternions.
- Parameters:
-
- Returns:
-
(!o3djs.quaternions.Quaternion|number).The quotient of a and b.
Divides two quaternions; assumes the convention that a/b = a*(1/b).
- Parameters:
-
| a |
Operand quaternion. |
| b |
Operand quaternion. |
- Returns:
-
!o3djs.quaternions.Quaternion.The quaternion quotient a / b.
Divides a Quaternion by a scalar.
- Parameters:
-
| q |
The quaternion. |
| k |
The scalar. |
- Returns:
-
!o3djs.quaternions.Quaternion.q The quaternion q divided by k.
Divides a scalar by a quaternion.
- Parameters:
-
| a |
Operand scalar. |
| b |
Operand quaternion. |
- Returns:
-
!o3djs.quaternions.Quaternion.The quaternion product.
Computes the length of a Quaternion, i.e. the square root of the
sum of the squares of the coefficients.
- Parameters:
-
- Returns:
-
number.The length of a.
Computes the square of the length of a quaternion, i.e. the sum of the
squares of the coefficients.
- Parameters:
-
- Returns:
-
number.The square of the length of a.
Quickly determines if the object a is a scalar or a quaternion;
assumes that the argument is either a number (scalar), or an array of
numbers.
- Parameters:
-
| a |
A number or array the type
of which is in question. |
- Returns:
-
string.Either the string 'Scalar' or 'Quaternion'.
Multiplies two objects which are either scalars or quaternions.
- Parameters:
-
- Returns:
-
(!o3djs.quaternions.Quaternion|number).The product of a and b.
Multiplies two quaternions.
- Parameters:
-
| a |
Operand quaternion. |
| b |
Operand quaternion. |
- Returns:
-
!o3djs.quaternions.Quaternion.The quaternion product a * b.
Multiplies a quaternion by a scalar.
- Parameters:
-
| q |
The Quaternion. |
| k |
The scalar. |
- Returns:
-
!o3djs.quaternions.Quaternion.The product of k and v.
Multiplies a scalar by a quaternion.
- Parameters:
-
| k |
The scalar. |
| q |
The quaternion. |
- Returns:
-
!o3djs.quaternions.Quaternion.The product of k and q.
Divides a Quaternion by its length and returns the quotient.
- Parameters:
-
- Returns:
-
!o3djs.quaternions.Quaternion.A unit length quaternion pointing in
the same direction as a.
Computes a 4-by-4 rotation matrix (with trivial translation component)
given a quaternion. We assume the convention that to rotate a vector v by
a quaternion r means to express that vector as a quaternion q by letting
q = [v[0], v[1], v[2], 0] and then obtain the rotated vector by evaluating
the expression (r * q) / r.
- Parameters:
-
- Returns:
-
!o3djs.math.Matrix4.A 4-by-4 rotation matrix.
Computes a quaternion whose rotation is equivalent to the given matrix.
- Parameters:
-
| m |
A 3-by-3 or 4-by-4
rotation matrix. |
- Returns:
-
!o3djs.quaternions.Quaternion.A quaternion q such that
quaternions.quaternionToRotation(q) is m.
Creates a quaternion which rotates around the x-axis by the given angle.
- Parameters:
-
| angle |
The angle by which to rotate (in radians). |
- Returns:
-
!o3djs.quaternions.Quaternion.The quaternion.
Creates a quaternion which rotates around the y-axis by the given angle.
- Parameters:
-
| angle |
The angle by which to rotate (in radians). |
- Returns:
-
!o3djs.quaternions.Quaternion.The quaternion.
Creates a quaternion which rotates around the z-axis by the given angle.
- Parameters:
-
| angle |
The angle by which to rotate (in radians). |
- Returns:
-
!o3djs.quaternions.Quaternion.The quaternion.
Subtracts two objects which are either scalars or quaternions.
- Parameters:
-
- Returns:
-
(!o3djs.quaternions.Quaternion|number).The difference of a and b.
Subtracts two quaternions.
- Parameters:
-
| a |
Operand quaternion. |
| b |
Operand quaternion. |
- Returns:
-
!o3djs.quaternions.Quaternion.The difference a - b.
Subtracts a scalar from a quaternion.
- Parameters:
-
| a |
Operand quaternion. |
| b |
Operand scalar. |
- Returns:
-
!o3djs.quaternions.Quaternion.The difference a - b.
Subtracts a quaternion from a scalar.
- Parameters:
-
| a |
Operand scalar. |
| b |
Operand quaternion. |
- Returns:
-
!o3djs.quaternions.Quaternion.The difference a - b.
Member Property Documentation
| !Array.<number> o3djs.quaternions.Quaternion
|