#include <string.h>
#include <stdio.h>
#include "MePrecision.h"
Functions | |
| MeReal | MeVector3AreaOfTriangle (const MeVector3 v1, const MeVector3 v2) |
| Calculate area of triangle given one vertex at the origin and other two supplied as arguments. More... | |
| void | MeQuaternionFromTM (const MeMatrix4 tm, MeVector4 q) |
| Convert rotation matrix of a transformation to a quaternion. More... | |
| void | MeQuaternionFiniteRotation (MeVector4 q, const MeVector3 w, const MeReal h) |
| Rotate a quaternion. More... | |
| void | MeQuaternionForRotation (MeVector4 q, const MeVector3 v1, const MeVector3 v2) |
| Calculates quaternion required to rotate v1 into v2; v1 and v2 MUST be normalised. More... | |
| void | MeMatrixFPrint (FILE *const file, const MeReal *const A, const int n, const int m, const char *const format) |
| Print a matrix to a file with a given format for each element. More... | |
| void | MeMatrix3Invert (MeMatrix3 a) |
| Replace the matrix m with its inverse. More... | |
| void | MeMatrix3InvertTo3x4 (const MeMatrix3 a, MeVector4 inv1, MeVector4 inv2, MeVector4 inv3) |
| Find inverse of a and put the results in 3 separate arrays. More... | |
| void | MeMatrix3MakeRotationX (const MeReal a, MeMatrix3 m) |
| Initialize a 3x3 matrix to be a rotation matrix by a given angle about the X axis. More... | |
| void | MeMatrix3MakeRotationY (const MeReal a, MeMatrix3 m) |
| Initialize a 3x3 matrix to be a rotation matrix by a given angle about the Y axis. More... | |
| void | MeMatrix3MakeRotationZ (const MeReal a, MeMatrix3 m) |
| Initialize a 3x3 matrix to be a rotation matrix by a given angle about the Z axis. More... | |
| void | MeAccumulateInertiaTensor (MeMatrix4 X_1, MeMatrix3 I_1, MeReal M_1, MeMatrix4 X_2, MeMatrix3 I_2, MeReal M_2, MeMatrix4 *X, MeMatrix3 *I, MeReal *M) |
| Combine two inertia tensors and relative centers of mass for a new combined rigid body. More... | |
| MeMathINLINE void | MeVectorSetZero (MeReal *const A, const int n) |
| Set the first +{n} elements of +{A} to zero. More... | |
| MeMathINLINE void | MeVector3Copy (const MeVector3 b, MeVector3 c) |
| MeVector3 copy. More... | |
| MeMathINLINE void | MeVector3Subtract (const MeVector3 b, const MeVector3 c, MeVector3 a) |
| MeVector3 subtraction. More... | |
| MeMathINLINE void | MeVector3Add (const MeVector3 b, const MeVector3 c, MeVector3 a) |
| MeVector3 addition. More... | |
| MeMathINLINE MeReal | MeVector3Dot (const MeVector3 b, const MeVector3 c) |
| MeVector3 dot product. More... | |
| MeMathINLINE void | MeVector3Cross (const MeVector3 b, const MeVector3 c, MeVector3 a) |
| MeVector3 cross product. More... | |
| MeMathINLINE void | MeVector3OuterProduct (const MeVector3 b, const MeVector3 c, MeMatrix3 a) |
| MeVector3 outer product. More... | |
| MeMathINLINE MeReal | MeVector3MagnitudeSqr (const MeVector3 v) |
| Return the square of the magnitude of the vector. More... | |
| MeMathINLINE void | MeVector3Scale (MeVector3 v, const MeReal a) |
| Multiply all elements of a 3 vector by a scalar. More... | |
| MeMathINLINE void | MeVector3MultiplyAdd (MeVector3 v, const MeReal a, const MeVector3 v1) |
| Add to each element of a 3 vector the corresponding element of another 3 vector multiplied by a scalar. More... | |
| MeMathINLINE void | MeVector3Normalize (MeVector3 v) |
| Make the given vector unit length. More... | |
| MeMathINLINE void | MeVector3MakeOrthogonal (MeVector3 v, const MeVector3 v1) |
| Compute a 3 vector orthogonal to another 3 vector. More... | |
| MeMathINLINE void | MeVector3PlaneSpace (const MeVector3 n, MeVector3 a, MeVector3 b) |
| Make normal 3x1 vectors +{a} and +{b} such that together with the normal 3x1 vector +{n} they form an orthonormal basis. More... | |
| MeMathINLINE void | MeVector4Copy (const MeVector4 b, MeVector4 c) |
| MeVector4 copy. More... | |
| MeMathINLINE void | MeVector4Subtract (const MeVector4 b, const MeVector4 c, MeVector4 a) |
| MeVector4 subtraction. More... | |
| MeMathINLINE void | MeQuaternionMake (MeVector3 x, MeReal a, MeVector4 q) |
| Make a Quaternion (q) given and normalised axis (x) and an angle (a). More... | |
| MeMathINLINE void | MeQuaternionToR (const MeVector4 q, MeMatrix3 R) |
| Compute a 3x3 rotation matrix +{R} from a 4x1 normalized quaternion +{q}. More... | |
| MeMathINLINE void | MeQuaternionToTM (const MeVector4 q, MeMatrix4 tm) |
| Convert a quaternion to a rotation matrix. More... | |
| MeMathINLINE void | MeQuaternionToD (const MeVector4 q, MeReal D[12]) |
| Return a 4x3 matrix +{D} corresponding to the 4x1 quaternion +{q} such that m{dq/dt = D * w}, where +{w} is the angular velocity. More... | |
| MeMathINLINE void | MeQuaternionWtoDQ (const MeVector4 q, const MeVector3 w, MeVector4 dq) |
| Given the angular velocity +{w} and the current quaternion +{q}, return the quaternion derivative +{dq}. More... | |
| MeMathINLINE void | MeQuaternionProduct (const MeVector4 p, const MeVector4 q, MeVector4 r) |
| Multiplication of quaternions: set m{r = p * q}. More... | |
| MeMathINLINE void | MeQuaternionRotateVector3 (MeVector3 vout, const MeVector4 q, const MeVector3 v) |
| Rotate a vector using a quaternion. More... | |
| MeMathINLINE void | MeMatrix3Copy (const MeMatrix3 B, MeMatrix3 A) |
| Matrix_3 Copy: A := B. More... | |
| MeMathINLINE void | MeMatrixTranspose (const int n, const int m, const MeReal *const B, MeReal *A) |
| Transpose of the n * m matrix B into A. More... | |
| MeMathINLINE void | MeMatrixMultiply ( const int p, const int q, const int r, const MeReal *const B, const MeReal *const C, MeReal *A) |
| Set m{A=B*C}, where +{A} is p*r, +{B} is p*q, +{C} is q*r. More... | |
| MeMathINLINE void | MeMatrixMultiplyT1 ( const int p, const int q, const int r, const MeReal *const B, const MeReal *const C, MeReal *A) |
| Set m{A=B^T*C}, where +{A} is p*r, +{B} is q*p, +{C} is q*r. More... | |
| MeMathINLINE void | MeMatrix3MakeIdentity (MeMatrix3 tm) |
| Make a 3x3 identity matrix. More... | |
| MeMathINLINE void | MeMatrix3Transpose (MeMatrix3 A) |
| In place (via an internal copy) transpose of the 3x3 matrix +{A}. More... | |
| MeMathINLINE void | MeMatrix3CrossFromVector (const MeVector3 a, const MeReal factor, MeVector3 A0, MeVector3 A1, MeVector3 A2) |
| Set +{A} to a 3x3 matrix corresponding to the 3x1 vector +{a}, such that m{A*b = a x b} (x is the cross product operator). More... | |
| MeMathINLINE void | MeMatrix3MultiplyVector (const MeMatrix3 B, const MeVector3 C, MeVector3 A) |
| Multiply a 3x3 matrix by a 3x1 vector. More... | |
| MeMathINLINE void | MeMatrix3Subtract (MeMatrix3 B, MeMatrix3 C, MeMatrix3 A) |
| Subtract 3x3 matrices. More... | |
| MeMathINLINE void | MeMatrix3Add (MeMatrix3 B, MeMatrix3 C, MeMatrix3 A) |
| Add 3x3 matrices. More... | |
| MeMathINLINE void | MeMatrix3Multiply (const MeMatrix3 B, const MeMatrix3 C, MeMatrix3 A) |
| Multiply 3x3 matrixes. More... | |
| MeMathINLINE void | MeMatrix3Scale (MeMatrix3 A, const MeReal a) |
| Multiply all elements of a 3x3 matrix by a scalar. More... | |
| MeMathINLINE void | MeMatrix4MakeIdentityTM (MeMatrix4 tm) |
| Make a 4x4 identity matrix. More... | |
| MeMathINLINE void | MeMatrix4SetPosition (MeMatrix4 tm, MeReal x, MeReal y, MeReal z) |
| Sets position for a MeMatrix4, when interpreted as a transformation matrix. More... | |
| MeMathINLINE void | MeMatrix4Copy (const MeMatrix4 B, MeMatrix4 A) |
| Matrix_4 Copy. More... | |
| MeMathINLINE void | MeMatrix4Transpose (MeMatrix4 A) |
| In place (via an internal copy) transpose of the 4x4 matrix +{A}. More... | |
| MeMathINLINE void | MeMatrix4Sum (const MeMatrix4 B, const MeMatrix4 C, MeMatrix4 A) |
| Matrix_4 Addition. More... | |
| MeMathINLINE void | MeMatrix4MultiplyVector (const MeMatrix4 B, const MeVector4 C, MeVector4 A) |
| Multiply a 4x4 matrix by a 4x1 vector. More... | |
| MeMathINLINE void | MeMatrix4Multiply (const MeMatrix4 B, const MeMatrix4 C, MeMatrix4 A) |
| Multiply 4x4 matrixes. More... | |
|
Combine two inertia tensors and relative centers of mass for a new combined rigid body.
This will be extended to Arrays versus pairs. X - CM vector I - Inertial Tensor M - Mass
|
Add 3x3 matrices.
|
Matrix_3 Copy: A := B.
|
Set +{A} to a 3x3 matrix corresponding to the 3x1 vector +{a}, such that m{A*b = a x b} (x is the cross product operator).
The result is multiplied by +{factor}.
|
Replace the matrix m with its inverse.
|
Find inverse of a and put the results in 3 separate arrays.
|
Make a 3x3 identity matrix.
|
Initialize a 3x3 matrix to be a rotation matrix by a given angle about the X axis.
|
Initialize a 3x3 matrix to be a rotation matrix by a given angle about the Y axis.
|
Initialize a 3x3 matrix to be a rotation matrix by a given angle about the Z axis.
|
Multiply 3x3 matrixes.
|
Multiply a 3x3 matrix by a 3x1 vector.
|
Multiply all elements of a 3x3 matrix by a scalar.
|
Subtract 3x3 matrices.
|
In place (via an internal copy) transpose of the 3x3 matrix +{A}.
|
Matrix_4 Copy.
|
Make a 4x4 identity matrix.
|
Multiply 4x4 matrixes.
|
Multiply a 4x4 matrix by a 4x1 vector.
|
Sets position for a MeMatrix4, when interpreted as a transformation matrix.
|
Matrix_4 Addition.
|
In place (via an internal copy) transpose of the 4x4 matrix +{A}.
|
Print a matrix to a file with a given format for each element.
|
Set m{A=B*C}, where +{A} is p*r, +{B} is p*q, +{C} is q*r.
This is an inline function for use on SMALL matrices.
|
Set m{A=B^T*C}, where +{A} is p*r, +{B} is q*p, +{C} is q*r.
This is an inline function for use on SMALL matrices.
|
Transpose of the n * m matrix B into A.
|
Rotate a quaternion.
|
Calculates quaternion required to rotate v1 into v2; v1 and v2 MUST be normalised.
|
Convert rotation matrix of a transformation to a quaternion.
|
Make a Quaternion (q) given and normalised axis (x) and an angle (a).
|
Multiplication of quaternions: set m{r = p * q}.
|
Rotate a vector using a quaternion.
vout=(q0^2-qv^2)v + 2(qv.v)qv + 2q0 qv_cross_v
|
Return a 4x3 matrix +{D} corresponding to the 4x1 quaternion +{q} such that m{dq/dt = D * w}, where +{w} is the angular velocity.
|
Compute a 3x3 rotation matrix +{R} from a 4x1 normalized quaternion +{q}.
|
Convert a quaternion to a rotation matrix.
|
Given the angular velocity +{w} and the current quaternion +{q}, return the quaternion derivative +{dq}.
dq/dt = D * w.
|
MeVector3 addition.
|
Calculate area of triangle given one vertex at the origin and other two supplied as arguments.
|
MeVector3 copy.
|
MeVector3 cross product.
|
MeVector3 dot product.
|
Return the square of the magnitude of the vector.
|
Compute a 3 vector orthogonal to another 3 vector.
|
Add to each element of a 3 vector the corresponding element of another 3 vector multiplied by a scalar.
|
Make the given vector unit length.
|
MeVector3 outer product.
|
Make normal 3x1 vectors +{a} and +{b} such that together with the normal 3x1 vector +{n} they form an orthonormal basis.
+{a} and +{b} span the plane that is normal to +{n}, and +{a} x +{b} = +{n}. Note that if +{n} is not normalized then +{b} will not be normalized either.
|
Multiply all elements of a 3 vector by a scalar.
|
MeVector3 subtraction.
|
MeVector4 copy.
|
MeVector4 subtraction.
|
Set the first +{n} elements of +{A} to zero.
Copyright MathEngine PLC 2000, all rights reserved.