Table of Contents

Class Transform

Namespace
NominalSystems.Maths
Assembly
NominalSystems.Maths.dll

[NominalSystems] A 3D Cartesian transformation class The transform is stored internally as a 4x4 homogeneous transform

public sealed class Transform
Inheritance
Transform

Constructors

Transform()

Default constructor (identity)

public Transform()

Transform(Matrix3)

Constructor from a DCM

public Transform(Matrix3 dcm)

Parameters

dcm Matrix3

The DCM

Transform(Matrix3, Vector3)

Constructor from a DCM and vector3 (orientation and position)

public Transform(Matrix3 dcm, Vector3 vector)

Parameters

dcm Matrix3

The DCM

vector Vector3

The position

Transform(Matrix4)

Constructor from a Matrix4

public Transform(Matrix4 matrix)

Parameters

matrix Matrix4

a 'Matrix4'

Transform(Transform)

Copy constructor

public Transform(Transform transform)

Parameters

transform Transform

a 'Transform'

Transform(Vector3)

Constructor from a position vector

public Transform(Vector3 position)

Parameters

position Vector3

The position

Transform(Vector3, Vector3, Vector3)

Constructor from unit vectors (orientation only)

public Transform(Vector3 right, Vector3 forward, Vector3 up)

Parameters

right Vector3

1st column axis

forward Vector3

2nd column axis

up Vector3

3rd column axis

Transform(Vector3, Vector3, Vector3, Vector3)

Constructor from unit vectors (orientation and position)

public Transform(Vector3 right, Vector3 forward, Vector3 up, Vector3 position)

Parameters

right Vector3

1st column axis

forward Vector3

2nd column axis

up Vector3

3rd column axis

position Vector3

position of the transform

Properties

Forward

The transform's forward axis (2nd column)

public Vector3 Forward { get; set; }

Property Value

Vector3

Inverse

Calculate the transpose of the current transform. The expected behaviour is to switch the notation of the frames.

public Transform Inverse { get; }

Property Value

Transform

this[int]

Get/Set the transform's value

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

Parameters

i int

the index

Property Value

double

this[int, int]

Get/Set the transform's value

public double this[int r, int c] { get; set; }

Parameters

r int

the row index

c int

the column index

Property Value

double

this[uint]

Get/Set the transform's value

public double this[uint i] { get; set; }

Parameters

i uint

the index

Property Value

double

Position

The transform's position vector (4th column)

public Vector3 Position { get; set; }

Property Value

Vector3

Right

The transform's right axis (1st column)

public Vector3 Right { get; set; }

Property Value

Vector3

Up

The transform's up axis (3rd column)

public Vector3 Up { get; set; }

Property Value

Vector3

Methods

Offset(Vector3)

Offset transform by amount (Vector3)

public Transform Offset(Vector3 a)

Parameters

a Vector3

Returns

Transform

PitchDegrees(Vector3, double)

Rotate frame about the Right axis (degrees)

public Transform PitchDegrees(Vector3 pivot, double a)

Parameters

pivot Vector3
a double

Returns

Transform

PitchDegrees(double)

Rotate frame about the Right axis (degrees)

public Transform PitchDegrees(double a)

Parameters

a double

Returns

Transform

PitchRadians(Vector3, double)

Rotate frame about the Right axis (radians)

public Transform PitchRadians(Vector3 pivot, double a)

Parameters

pivot Vector3
a double

Returns

Transform

PitchRadians(double)

Rotate frame about the Right axis (radians)

public Transform PitchRadians(double a)

Parameters

a double

Returns

Transform

RollDegrees(Vector3, double)

Rotate frame about the Forward axis (degrees)

public Transform RollDegrees(Vector3 pivot, double a)

Parameters

pivot Vector3
a double

Returns

Transform

RollDegrees(double)

Rotate frame about the Forward axis (degrees)

public Transform RollDegrees(double a)

Parameters

a double

Returns

Transform

RollRadians(Vector3, double)

Rotate frame about the Forward axis (radians)

public Transform RollRadians(Vector3 pivot, double a)

Parameters

pivot Vector3
a double

Returns

Transform

RollRadians(double)

Rotate frame about the Forward axis (radians)

public Transform RollRadians(double a)

Parameters

a double

Returns

Transform

Rotate(Vector3, Matrix3)

Rotate transform by amount (DCM matrix)

public Transform Rotate(Vector3 pivot, Matrix3 dcm)

Parameters

pivot Vector3
dcm Matrix3

Returns

Transform

SetDCM(Matrix3)

Updates the DCM of the transform to a new value

public void SetDCM(Matrix3 dcm)

Parameters

dcm Matrix3

The 3x3 DCM matrix

SetRotation(Matrix3)

Updates the Rotation matrix of the transform to a new value

public void SetRotation(Matrix3 rotation)

Parameters

rotation Matrix3

The 3x3 Rotation matrix

ToDCM()

Returns the DCM representing the rotation part of the transform

public Matrix3 ToDCM()

Returns

Matrix3

DCM Matrix

ToRotation()

Returns the Rotation matrix part of the transform

public Matrix3 ToRotation()

Returns

Matrix3

Rotation Matrix

ToString()

public override string ToString()

Returns

string

YawDegrees(Vector3, double)

Rotate frame about the Up axis (degrees)

public Transform YawDegrees(Vector3 pivot, double a)

Parameters

pivot Vector3
a double

Returns

Transform

YawDegrees(double)

Rotate frame about the Up axis (degrees)

public Transform YawDegrees(double a)

Parameters

a double

Returns

Transform

YawRadians(Vector3, double)

Rotate frame about the Up axis (radians)

public Transform YawRadians(Vector3 pivot, double a)

Parameters

pivot Vector3
a double

Returns

Transform

YawRadians(double)

Rotate frame about the Up axis (radians)

public Transform YawRadians(double a)

Parameters

a double

Returns

Transform

Operators

explicit operator Matrix3(Transform)

Explicit cast 'Transform' to a 'Matrix3' DCM

public static explicit operator Matrix3(Transform a)

Parameters

a Transform

Returns

Matrix3

explicit operator Matrix4(Transform)

Explicit cast 'Transform' to 'Matrix4'

public static explicit operator Matrix4(Transform a)

Parameters

a Transform

Returns

Matrix4

implicit operator Transform(Matrix)

Implicit cast 'Transform' from 'Matrix'

public static implicit operator Transform(Matrix a)

Parameters

a Matrix

Returns

Transform

implicit operator Transform(Matrix3)

Implicit cast 'Transform' from a 'Matrix3' DCM

public static implicit operator Transform(Matrix3 a)

Parameters

a Matrix3

Returns

Transform

implicit operator Matrix(Transform)

Implicit cast 'Transform' to 'Matrix'

public static implicit operator Matrix(Transform a)

Parameters

a Transform

Returns

Matrix

operator *(Transform, Transform)

Transform * Transform => Transform

public static Transform operator *(Transform a, Transform b)

Parameters

a Transform
b Transform

Returns

Transform

operator *(Transform, Vector3)

Transform * Vector3 => Vector3 Transform a vector into a new coordinate system, considering rotation and translation

public static Vector3 operator *(Transform a, Vector3 b)

Parameters

a Transform
b Vector3

Returns

Vector3