SQuatD
A Quaternion.
Quaternions are used to represent rotations. They are compact, don't suffer from gimbal lock and can easily be interpolated.
Constructors
Method New(x:Double, y:Double, z:Double, w:Double = 1)
Creates a new SQuatD from the supplied arguments.
Operators
Method Operator*:SQuatD(b:SQuatD)
Multiplies the quaternion by b, returning a new quaternion.
Method Operator-:SQuatD()
Returns a new quaternion, negated.
Methods
Method AngleTo:Double(quat:SQuatD)
Returns the angle between ths quaternion and the quaternion quat.
Method Dot:Double(b:SQuatD)
The dot product between two rotations.
Method Invert:SQuatD()
Returns the Inverse of rotation.
Method Interpolate:SQuatD(b:SQuatD, t:Double)
Interpolates between the SQuatD and b by t and normalizes the result afterwards.
Method Length:Double()
Computes the length of this quaternion, considered as a 4 dimensional vector.
Method LengthSquared:Double()
Computes the length of this quaternion, considered as a 4 dimensional vector.
Calculating the squared length instead of the length is much faster. Often if you are comparing lengths of two quaternions you can just compare their squared lengths.
Method Normal:SQuatD()
Converts this quaternion to one with the same orientation but with a magnitude of 1.
Method RotateTowards:SQuatD(quat:SQuatD, s:Double)
Rotates this quaternion by a given angular step s to the specified quaternion quat.
Method SphericalInterpolate:SQuatD(b:SQuatD, t:Double)
Spherically interpolates between this SQuatD and b by t.
Method EulerRotate:SQuatD(rot:SVec3D, order:ERotationOrder = ERotationOrder.XYZ)
Returns a rotation that rotates around rot.
Method ToEuler:SVec3D(order:ERotationOrder = ERotationOrder.XYZ)
Returns the quaternion converted to Euler angles, using the specified rotation order.
Method ToString:String() Override
Returns a String representation of the quaternion.
Functions
Function CreateFromEuler:SQuatD(euler:SVec3D, order:ERotationOrder = ERotationOrder.XYZ)
Creates a new SQuatD from the rotation specified by the euler angle and order.
Function CreateFromRotation:SQuatD(mat:SMat4D)
Creates a new SQuatD from the rotation component of matrix mat.
see http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm
Function ToMat3:SMat3D(a:SQuatD)
Applies the quaternion a to the matrix, returning a new matrix.
Function ToMat4:SMat4D(a:SQuatD)
Applies the quaternian to the matrix, return the new matrix.
Function RotTrans:SMat4D(a:SQuatD, s:SVec3D)
Creates a translation and rotation matrix.
The returned matrix is such that it places objects at position s, oriented in rotation a.
Function RotTransOrigin:SMat4D(a:SQuatD, s:SVec3D, origin:SVec3D)
Creates a translation, rotation and scaling matrix.
The returned matrix is such that it places objects at position origin, oriented in rotation a and scaled by s.
Function Identity:SQuatD()
The identity rotation.