Table of Contents

Class LinearAlgebra

Namespace
NominalSystems.Maths
Assembly
NominalSystems.Maths.dll

Helper functions that can help reset some matrices.

public static class LinearAlgebra
Inheritance
LinearAlgebra

Fields

DB0_EPS

The small value minimum

public const double DB0_EPS = 1E-30

Field Value

double

Methods

GetInertiaTensor(Vector3, double)

Returns the inertia tensor of a particular point mass based on the position of the component in 3D space.

public static Matrix3 GetInertiaTensor(Vector3 position, double mass)

Parameters

position Vector3

[m] The position of the component

mass double

[kg] The mass of the component

Returns

Matrix3

[kg m^2] The inertial tensor as a 3x3 matrix

Lerp(double, double, double)

Lerps between two values with some time parameter between 0 and 1

public static double Lerp(double a, double b, double t)

Parameters

a double

Parameter a

b double

Parameter b

t double

Some time fraction interval

Returns

double

The lerped value between a and b at t

Lerp(double, double, double, double, double)

Lerps between two values with a set of time values to lerp between. The two time values and the actual value of the time will be calculated and will find the interpolation.

public static double Lerp(double a, double b, double t1, double t2, double tval)

Parameters

a double

Parameter a

b double

Parameter b

t1 double

The previous time step

t2 double

The next time step

tval double

The current time step

Returns

double

The lerped value between a and b at t

Matrix33ToEuler(Matrix3)

Retrives the euler angles from a rotation matrix

public static Vector3 Matrix33ToEuler(Matrix3 m)

Parameters

m Matrix3

Rotation 3x3 matrix

Returns

Vector3

A reference Euler vector for pitch, roll, yaw

Matrix66ToMatrix33(int, int, double[,])

Sets a 3x3 matrix from a portion of the 6x6 one

public static Matrix3 Matrix66ToMatrix33(int row, int col, double[,] m)

Parameters

row int

The row index to start (x3)

col int

The column index to start (x3)

m double[,]

The input matrix to use

Returns

Matrix3

The output matrix from the 6x6 one