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
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
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
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
doubleParameter a
b
doubleParameter b
t1
doubleThe previous time step
t2
doubleThe next time step
tval
doubleThe 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
Matrix3Rotation 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
intThe row index to start (x3)
col
intThe column index to start (x3)
m
double[,]The input matrix to use
Returns
- Matrix3
The output matrix from the 6x6 one