Class NsQuat
- Namespace
- NominalSystems.Maths
- Assembly
- NominalSystems.Maths.dll
Wrapper for the Quaternion class
public sealed class NsQuat
- Inheritance
-
NsQuat
Constructors
NsQuat()
Default constructor of the Quaternion
public NsQuat()
NsQuat(Quaternion)
Creates a new Quaternion based on another NsQuat
public NsQuat(Quaternion other)
Parameters
other
QuaternionA copied Quaternion value
NsQuat(NsQuat)
Creates a new Quaternion based on another NsQuat
public NsQuat(NsQuat other)
Parameters
other
NsQuatA copied NsQuat value
NsQuat(double, double, double, double)
Creates a new Quaternion with the components
public NsQuat(double W, double X, double Y, double Z)
Parameters
W
doubleThe Real component
X
doubleThe Imaginary X axis
Y
doubleThe Imaginary Y axis
Z
doubleThe Imaginary Z axis
NsQuat(double[])
Creates a quaternion from an array of 4 values
public NsQuat(double[] array)
Parameters
array
double[]A double array with 4 values
Fields
Value
The actual value of the quaternion
public Quaternion Value
Field Value
- Quaternion
Properties
ImagX
Returns the Imaginary X value of the Quaternion
public double ImagX { get; }
Property Value
ImagY
Returns the Imaginary Y value of the Quaternion
public double ImagY { get; }
Property Value
ImagZ
Returns the Imaginary Z value of the Quaternion
public double ImagZ { get; }
Property Value
Inversed
Returns the Inverse of the Quaternion as a new Quaternion
public NsQuat Inversed { get; }
Property Value
this[int]
Overrides the index operations for setting and getting
public double this[int key] { get; set; }
Parameters
key
intThe key index [0, 1, 2, 3]
Property Value
- double
The resultant double of the value
Normalized
Returns a Normalized Quaternion with the direction of this Quaternion
public NsQuat Normalized { get; }
Property Value
Real
Returns the Real value of the Quaternion
public double Real { get; }
Property Value
W
Returns the Real value of the Quaternion
public double W { get; }
Property Value
X
Returns the Imaginary X value of the Quaternion
public double X { get; }
Property Value
Y
Returns the Imaginary Y value of the Quaternion
public double Y { get; }
Property Value
Z
Returns the Imaginary Z value of the Quaternion
public double Z { get; }
Property Value
Methods
RotateUnitQuaternion(NsQuat)
Rotates the provided Unit Quaternion with this one
public NsQuat RotateUnitQuaternion(NsQuat quat)
Parameters
quat
NsQuatA unit quaternion
Returns
- NsQuat
A new Quaternion
Set(Quaternion)
Sets the Quaternion to the value of another quaternion
public void Set(Quaternion other)
Parameters
other
QuaternionThe Quaternion to copy
Set(NsQuat)
Sets the Quaternion to the value of another NsQuat
public void Set(NsQuat other)
Parameters
other
NsQuatThe Quaternion to copy
Set(double[])
Sets the Quaternion to the value of a double array of 4 values
public void Set(double[] other)
Parameters
other
double[]The double array to copy
ToEulerAngles()
Calculates the Euler angles of the Quaternion in Radians
public Vector3 ToEulerAngles()
Returns
- Vector3
The Euler angles in Radians
Operators
implicit operator Vector4(NsQuat)
Converts a Quaternion to a Vector4 data structure
public static implicit operator Vector4(NsQuat quat)
Parameters
quat
NsQuatThe quaternion to convert
Returns
implicit operator double[](NsQuat)
Converts a Quaternion to a double array
public static implicit operator double[](NsQuat quat)
Parameters
quat
NsQuatThe quaternion to convert
Returns
- double[]