Constructs a quaternion defined by Tait-Byran angles, also loosely known as Euler angles.
Parameters:| yaw (double) | Angle, in radians, to rotate about the ZAxis. |
| pitch (double) | Angle, in radians, to rotate about the YAxis. |
| roll (double) | Angle, in radians, to rotate about the XAxis. |
Returns: The quaternion.
Constructs a quaternion defined by Euler angles.
Parameters:| alpha (double) | Angle, in radians, to rotate about the ZAxis. |
| beta (double) | Angle, in radians, to rotate about the YAxis. |
| gamma (double) | Angle, in radians, to rotate about the ZAxis. |
Returns: The quaternion.
Computes the vector cross product of p and q = (0,x,y,z),
where (x,y,z) = CrossProduct(p.Vector,q.Vector).
This is not the same as the quaternion product p*q.
Returns: A new quaternion.
Returns the distance or norm of the difference between two quaternions.
Returns: (p - q).Length()
Computes the distance or norm of the difference between this and another quaternion.
Returns: (this - q).Length.
Check that all values in other are within epsilon of the values in this
[ConstOperation]
public override bool Equals(object obj
) Determines whether an object is a quaternion and has the same value of this quaternion.
Parameters:| obj (object) | Another object to compare. |
Returns: true if obj is a quaternion and has exactly equal coefficients; otherwise false.
Determines whether this quaternion has the same value of another quaternion.
Returns: true if the quaternions have exactly equal coefficients; otherwise false.
Find the Euler angles for a rotation transformation.
Parameters:| alpha (out double) | Angle, in radians, to rotate about the ZAxis. |
| beta (out double) | Angle, in radians, to rotate about the YAxis. |
| gamma (out double) | Angle, in radians, to rotate about the ZAxis. |
Returns: true if successful, or false if this is not a rotation.
[ConstOperation]
public override int GetHashCode() Gets a non-unique but repeatable hashing code for this quaternion.
Returns: A signed number.
Returns the rotation defined by the quaternion.
Parameters:| angle (out double) | An angle in radians. |
| axis (out Vector3d) | unit axis of rotation of 0 if (b,c,d) is the zero vector. |
Returns: True if the operation succeeded; otherwise, false.
[ConstOperation]
public bool GetRotation(out Plane plane
) Returns the frame created by applying the quaternion's rotation to the canonical world frame (1,0,0),(0,1,0),(0,0,1).
Parameters:| plane (out Plane) | A plane. This out value will be assigned during this call. |
Returns: true if the operation succeeded; otherwise, false.
Find sthe Tait-Byran angles, also loosely called Euler angles, for this quaternion.
Parameters:| yaw (out double) | Angle, in radians, to rotate about the ZAxis. |
| pitch (out double) | Angle, in radians, to rotate about the YAxis. |
| roll (out double) | Angle, in radians, to rotate about the XAxis. |
Returns: true if successful, or false if this is not a rotation.
Modifies this quaternion to become
(a/L2, -b/L2, -c/L2, -d/L2),
where L2 = length squared = (a*a + b*b + c*c + d*d).
This is the multiplicative inverse, i.e., (a,b,c,d)*(a/L2, -b/L2, -c/L2, -d/L2) = (1,0,0,0).
Returns: true if successful. false if the quaternion is zero and cannot be inverted.
Interpolates between two quaternions, using linear interpolation.
Returns: The interpolated quaternion.
The quaternion product of p and q. This is the same value as p*q.
Returns: A transform value.
Rotates a 3d vector. This operation is also called conjugation, because the result is the same as (q.Conjugate()*(0,x,y,x)*q/q.LengthSquared).Vector.
Returns: R*v, where R is the rotation defined by the unit quaternion. This is mathematically the same as the values (Inverse(q)*(0,x,y,z)*q).Vector and (q.Conjugate()*(0,x,y,x)*q/q.LengthSquared).Vector.
Returns the quaternion obtained by rotating a towards b, limiting the rotation by MaxRadians.
Returns: The rotated quaternion.
Returns the unit quaternion cos(angle/2), sin(angle/2)*x, sin(angle/2)*y, sin(angle/2)*z where (x,y,z) is the unit vector parallel to axis. This is the unit quaternion that represents the rotation of angle about axis.
Parameters:| angle (double) | An angle in radians. |
| axisOfRotation (Vector3d) | The axis of rotation. |
Returns: A new quaternion.
Returns the unit quaternion that represents the rotation that maps plane0.xaxis to plane1.xaxis, plane0.yaxis to plane1.yaxis, and plane0.zaxis to plane1.zaxis.
Parameters:| plane0 (Plane) | The first plane. |
| plane1 (Plane) | The second plane. |
Returns: A quaternion value.
Sets all coefficients of the quaternion.
Sets the quaternion to cos(angle/2), sin(angle/2)*x, sin(angle/2)*y, sin(angle/2)*z where (x,y,z) is the unit vector parallel to axis. This is the unit quaternion that represents the rotation of angle about axis.
Parameters:| angle (double) | in radians. |
| axisOfRotation (Vector3d) | The direction of the axis of rotation. |
public void SetRotation(Plane plane0
, Plane plane1
) Sets the quaternion to the unit quaternion which rotates plane0.xaxis to plane1.xaxis, plane0.yaxis to plane1.yaxis, and plane0.zaxis to plane1.zaxis.
Parameters:| plane0 (Plane) | The "from" rotation plane. Origin point is ignored. |
| plane1 (Plane) | The "to" rotation plane. Origin point is ignored. |
Interpolates between two quaternions, using spherical linear interpolation.
Returns: The interpolated quaternion.
[ConstOperation]
public override string ToString() Returns a string representation of this Quaternion.
Returns: A textual representation.
Scales the quaternion's coordinates so that a*a + b*b + c*c + d*d = 1.
Returns: true if successful. false if the quaternion is zero and cannot be unitized.