dcm
Matrix.h@0:2b4ec92bff8b, 2014-02-20 (annotated)
- Committer:
- wisnup
- Date:
- Thu Feb 20 04:07:36 2014 +0000
- Revision:
- 0:2b4ec92bff8b
dcm
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wisnup | 0:2b4ec92bff8b | 1 | #ifndef __MATRIX_H |
wisnup | 0:2b4ec92bff8b | 2 | #define __MATRIX_H |
wisnup | 0:2b4ec92bff8b | 3 | |
wisnup | 0:2b4ec92bff8b | 4 | /** Take cross product of two 3x1 vectors: v1 x v2 = vectorOut |
wisnup | 0:2b4ec92bff8b | 5 | * @param v1 is the first vector |
wisnup | 0:2b4ec92bff8b | 6 | * @param v2 is the second vector |
wisnup | 0:2b4ec92bff8b | 7 | * @returns vectorOut = v1 x v2 |
wisnup | 0:2b4ec92bff8b | 8 | */ |
wisnup | 0:2b4ec92bff8b | 9 | void Vector_Cross_Product(float vectorOut[3], float v1[3], float v2[3]); |
wisnup | 0:2b4ec92bff8b | 10 | |
wisnup | 0:2b4ec92bff8b | 11 | /** Multiple 3x1 vector by scalar: vectorOut = vectorIn times scale2 |
wisnup | 0:2b4ec92bff8b | 12 | * @param vectorIn the vector |
wisnup | 0:2b4ec92bff8b | 13 | * @param scale2 is the scalar |
wisnup | 0:2b4ec92bff8b | 14 | * @returns vectorOut the result |
wisnup | 0:2b4ec92bff8b | 15 | */ |
wisnup | 0:2b4ec92bff8b | 16 | void Vector_Scale(float vectorOut[3], float vectorIn[3], float scale2); |
wisnup | 0:2b4ec92bff8b | 17 | |
wisnup | 0:2b4ec92bff8b | 18 | /** TDot product of two 3x1 vectors vector1 . vector2 |
wisnup | 0:2b4ec92bff8b | 19 | * @param vector1 is the first vector |
wisnup | 0:2b4ec92bff8b | 20 | * @param vector2 is the second vector |
wisnup | 0:2b4ec92bff8b | 21 | * @returns float result of dot product |
wisnup | 0:2b4ec92bff8b | 22 | */ |
wisnup | 0:2b4ec92bff8b | 23 | float Vector_Dot_Product(float vector1[3], float vector2[3]); |
wisnup | 0:2b4ec92bff8b | 24 | |
wisnup | 0:2b4ec92bff8b | 25 | /** Adds two 3x1 vectors: vectorOut = vectorIn1 + vectorIn2 |
wisnup | 0:2b4ec92bff8b | 26 | * @param vectorIn1 is the first vector |
wisnup | 0:2b4ec92bff8b | 27 | * @param vectorIn2 is the second vector |
wisnup | 0:2b4ec92bff8b | 28 | * @returns vectorOut is the result of the addition |
wisnup | 0:2b4ec92bff8b | 29 | */ |
wisnup | 0:2b4ec92bff8b | 30 | void Vector_Add(float vectorOut[3], float vectorIn1[3], float vectorIn2[3]); |
wisnup | 0:2b4ec92bff8b | 31 | |
wisnup | 0:2b4ec92bff8b | 32 | /** Multiplies two 3x3 matrices to get a third 3x3 matrix: c = ab |
wisnup | 0:2b4ec92bff8b | 33 | * @param a is the first vector |
wisnup | 0:2b4ec92bff8b | 34 | * @param b is the second vector |
wisnup | 0:2b4ec92bff8b | 35 | * @returns c as the result of the mutliplication |
wisnup | 0:2b4ec92bff8b | 36 | */ |
wisnup | 0:2b4ec92bff8b | 37 | void Matrix_Multiply(float c[3][3], float a[3][3], float b[3][3]); |
wisnup | 0:2b4ec92bff8b | 38 | |
wisnup | 0:2b4ec92bff8b | 39 | #endif |