Table of Contents

Struct DCM

Namespace
NominalSystems
Assembly
NominalSystems.Core.dll

Represents a 3D rotation, also known as a Direction Cosine Matrix (in DCM).


public struct DCM : IEnumerable<double>, IEnumerable
Implements

Constructors

DCM()

Creates a identity/default DCM.

public DCM()

DCM(in DCM)

Creates a deep-copy from another DCM.

public DCM(in DCM other)

Parameters

other DCM

A DCM to copy.

DCM(in Vector3, in Vector3, in Vector3)

Creates and initializes DCM from direction/unit axes.

public DCM(in Vector3 right, in Vector3 forward, in Vector3 up)

Parameters

right Vector3

A right unit vector/axis.

forward Vector3

A forward unit vector/axis.

up Vector3

A up unit vector/axis.

DCM(in Vector3, in double)

Creates and initializes DCM from axis angle.

public DCM(in Vector3 axis, in double angle)

Parameters

axis Vector3

A unit vector/axis.

angle double

A angle in radians.

Properties

Forward

A unit vector representing the 3D forward direction.

public readonly Vector3 Forward { get; }

Property Value

Vector3

Inverse

A DCM representing the inverse of the current rotation.

public readonly DCM Inverse { get; }

Property Value

DCM

Right

A unit vector representing the 3D right direction.

public readonly Vector3 Right { get; }

Property Value

Vector3

Up

A unit vector representing the 3D up direction.

public readonly Vector3 Up { get; }

Property Value

Vector3

Methods

Equals(object)

public override readonly bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(object, in double)

public readonly bool Equals(object obj, in double precision)

Parameters

obj object

The object to compare.

precision double

The precision error.

Returns

bool

GetEnumerator()

public readonly IEnumerator<double> GetEnumerator()

Returns

IEnumerator<double>

GetHashCode()

public override readonly int GetHashCode()

Returns

int

Rotate(in Vector3, in double)

Rotates the DCM at the specified axis angle.

public void Rotate(in Vector3 axis, in double angle)

Parameters

axis Vector3

A unit vector/axis.

angle double

A angle in radians.

ToString()

public override readonly string ToString()

Returns

string

ToString(string)

public readonly string ToString(string fmt)

Parameters

fmt string

A numeric format string.

Returns

string

Operators

operator *(in DCM, in DCM)

Returns the multiplication of a matrix with another matrix.

public static DCM operator *(in DCM a, in DCM b)

Parameters

a DCM
b DCM

Returns

DCM

operator *(in DCM, in Vector3)

Returns the multiplication of a matrix with a column vector.

public static Vector3 operator *(in DCM a, in Vector3 b)

Parameters

a DCM
b Vector3

Returns

Vector3