Table of Contents

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 Quaternion

A copied Quaternion value

NsQuat(NsQuat)

Creates a new Quaternion based on another NsQuat

public NsQuat(NsQuat other)

Parameters

other NsQuat

A 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 double

The Real component

X double

The Imaginary X axis

Y double

The Imaginary Y axis

Z double

The 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

double

ImagY

Returns the Imaginary Y value of the Quaternion

public double ImagY { get; }

Property Value

double

ImagZ

Returns the Imaginary Z value of the Quaternion

public double ImagZ { get; }

Property Value

double

Inversed

Returns the Inverse of the Quaternion as a new Quaternion

public NsQuat Inversed { get; }

Property Value

NsQuat

this[int]

Overrides the index operations for setting and getting

public double this[int key] { get; set; }

Parameters

key int

The 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

NsQuat

Real

Returns the Real value of the Quaternion

public double Real { get; }

Property Value

double

W

Returns the Real value of the Quaternion

public double W { get; }

Property Value

double

X

Returns the Imaginary X value of the Quaternion

public double X { get; }

Property Value

double

Y

Returns the Imaginary Y value of the Quaternion

public double Y { get; }

Property Value

double

Z

Returns the Imaginary Z value of the Quaternion

public double Z { get; }

Property Value

double

Methods

RotateUnitQuaternion(NsQuat)

Rotates the provided Unit Quaternion with this one

public NsQuat RotateUnitQuaternion(NsQuat quat)

Parameters

quat NsQuat

A 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 Quaternion

The Quaternion to copy

Set(NsQuat)

Sets the Quaternion to the value of another NsQuat

public void Set(NsQuat other)

Parameters

other NsQuat

The 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 NsQuat

The quaternion to convert

Returns

Vector4

implicit operator double[](NsQuat)

Converts a Quaternion to a double array

public static implicit operator double[](NsQuat quat)

Parameters

quat NsQuat

The quaternion to convert

Returns

double[]