-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmatrix.h
41 lines (34 loc) · 1.35 KB
/
matrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//==============================================================================
// File: matrix.h
//
// Copyright (c) 2017, Phil Harvey, Queen's University
//==============================================================================
#ifndef __matrix_h__
#define __matrix_h__
#define MNUM 3
typedef float Vector3[MNUM];
typedef float Matrix3[MNUM][MNUM];
#ifdef __cplusplus
extern "C" {
#endif
void combineVector4(float m[3][4], int row, int col, int src);
void getRotAlign(Vector3 p, Matrix3 out);
void getRotAlignInv(Vector3 p, Matrix3 out);
void getRotAlignScaled(Vector3 p, Matrix3 out);
void get3DMatrix(Matrix3 rot, float alpha, float beta, float gamma);
void getRotMatrix(Matrix3 rot, float theta, float phi, float alpha);
void getRotMatrixYXZ(Matrix3 rot, double alpha, double beta, double gamma);
void matrixIdent(Matrix3 m);
void matrixInvert(Matrix3 in,Matrix3 out );
void matrixSolve(Matrix3 m, Vector3 in, Vector3 out);
void matrixTranspose(Matrix3 in, Matrix3 out);
void matrixMult(Matrix3 d, Matrix3 s);
void vectorMult(Matrix3 m, Vector3 in, Vector3 out);
void lubksb(float a[MNUM][MNUM], int indx[MNUM], float b[MNUM]);
void ludcmp(float a[MNUM][MNUM], int indx[MNUM], float *d);
float vectorLen(float x, float y, float z );
int unitVector(Vector3 v);
#ifdef __cplusplus
}
#endif
#endif