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
Matrix3The DCM
Transform(Matrix3, Vector3)
Constructor from a DCM and vector3 (orientation and position)
public Transform(Matrix3 dcm, Vector3 vector)
Parameters
Transform(Matrix4)
Constructor from a Matrix4
public Transform(Matrix4 matrix)
Parameters
matrix
Matrix4a 'Matrix4'
Transform(Transform)
Copy constructor
public Transform(Transform transform)
Parameters
transform
Transforma 'Transform'
Transform(Vector3)
Constructor from a position vector
public Transform(Vector3 position)
Parameters
position
Vector3The position
Transform(Vector3, Vector3, Vector3)
Constructor from unit vectors (orientation only)
public Transform(Vector3 right, Vector3 forward, Vector3 up)
Parameters
Transform(Vector3, Vector3, Vector3, Vector3)
Constructor from unit vectors (orientation and position)
public Transform(Vector3 right, Vector3 forward, Vector3 up, Vector3 position)
Parameters
right
Vector31st column axis
forward
Vector32nd column axis
up
Vector33rd column axis
position
Vector3position of the transform
Properties
Forward
The transform's forward axis (2nd column)
public Vector3 Forward { get; set; }
Property Value
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
this[int]
Get/Set the transform's value
public double this[int i] { get; set; }
Parameters
i
intthe index
Property Value
this[int, int]
Get/Set the transform's value
public double this[int r, int c] { get; set; }
Parameters
Property Value
this[uint]
Get/Set the transform's value
public double this[uint i] { get; set; }
Parameters
i
uintthe index
Property Value
Position
The transform's position vector (4th column)
public Vector3 Position { get; set; }
Property Value
Right
The transform's right axis (1st column)
public Vector3 Right { get; set; }
Property Value
Up
The transform's up axis (3rd column)
public Vector3 Up { get; set; }
Property Value
Methods
Offset(Vector3)
Offset transform by amount (Vector3)
public Transform Offset(Vector3 a)
Parameters
a
Vector3
Returns
PitchDegrees(Vector3, double)
Rotate frame about the Right axis (degrees)
public Transform PitchDegrees(Vector3 pivot, double a)
Parameters
Returns
PitchDegrees(double)
Rotate frame about the Right axis (degrees)
public Transform PitchDegrees(double a)
Parameters
a
double
Returns
PitchRadians(Vector3, double)
Rotate frame about the Right axis (radians)
public Transform PitchRadians(Vector3 pivot, double a)
Parameters
Returns
PitchRadians(double)
Rotate frame about the Right axis (radians)
public Transform PitchRadians(double a)
Parameters
a
double
Returns
RollDegrees(Vector3, double)
Rotate frame about the Forward axis (degrees)
public Transform RollDegrees(Vector3 pivot, double a)
Parameters
Returns
RollDegrees(double)
Rotate frame about the Forward axis (degrees)
public Transform RollDegrees(double a)
Parameters
a
double
Returns
RollRadians(Vector3, double)
Rotate frame about the Forward axis (radians)
public Transform RollRadians(Vector3 pivot, double a)
Parameters
Returns
RollRadians(double)
Rotate frame about the Forward axis (radians)
public Transform RollRadians(double a)
Parameters
a
double
Returns
Rotate(Vector3, Matrix3)
Rotate transform by amount (DCM matrix)
public Transform Rotate(Vector3 pivot, Matrix3 dcm)
Parameters
Returns
SetDCM(Matrix3)
Updates the DCM of the transform to a new value
public void SetDCM(Matrix3 dcm)
Parameters
dcm
Matrix3The 3x3 DCM matrix
SetRotation(Matrix3)
Updates the Rotation matrix of the transform to a new value
public void SetRotation(Matrix3 rotation)
Parameters
rotation
Matrix3The 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
YawDegrees(Vector3, double)
Rotate frame about the Up axis (degrees)
public Transform YawDegrees(Vector3 pivot, double a)
Parameters
Returns
YawDegrees(double)
Rotate frame about the Up axis (degrees)
public Transform YawDegrees(double a)
Parameters
a
double
Returns
YawRadians(Vector3, double)
Rotate frame about the Up axis (radians)
public Transform YawRadians(Vector3 pivot, double a)
Parameters
Returns
YawRadians(double)
Rotate frame about the Up axis (radians)
public Transform YawRadians(double a)
Parameters
a
double
Returns
Operators
explicit operator Matrix3(Transform)
Explicit cast 'Transform' to a 'Matrix3' DCM
public static explicit operator Matrix3(Transform a)
Parameters
Returns
explicit operator Matrix4(Transform)
Explicit cast 'Transform' to 'Matrix4'
public static explicit operator Matrix4(Transform a)
Parameters
Returns
implicit operator Transform(Matrix)
Implicit cast 'Transform' from 'Matrix'
public static implicit operator Transform(Matrix a)
Parameters
a
Matrix
Returns
implicit operator Transform(Matrix3)
Implicit cast 'Transform' from a 'Matrix3' DCM
public static implicit operator Transform(Matrix3 a)
Parameters
a
Matrix3
Returns
implicit operator Matrix(Transform)
Implicit cast 'Transform' to 'Matrix'
public static implicit operator Matrix(Transform a)
Parameters
Returns
operator *(Transform, Transform)
Transform * Transform => Transform
public static Transform operator *(Transform a, Transform b)
Parameters
Returns
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)