A super simple linear algebra library created for use with yoyoengine.
No gaurantees are made for correctness or optimization, I rolled this myself for fun and to learn.
- 3x3 matrix operations
- 2D vector operations
#include <Lilith.h>
int main() {
mat3_t identity = lla_mat3_identity();
mat3_t scale = lla_mat3_scale(identity, 2.0f);
mat3_t test = lla_mat3(10.0f, 80.0f, 4.0f, 5.0f, 78.0f, 9.0f, 47.0f, 9.0f, 5.0f);
mat3_t result = lla_mat3_mult(scale, test);
const char* res_str = lla_mat3_string(result);
printf("%s\n", res_str);
free((void*)res_str);
/*
Output:
[20.000000, 160.000000, 8.000000]
[10.000000, 156.000000, 18.000000]
[94.000000, 18.000000, 10.000000]
*/
}
- vec3 and appropriate mult funcs?
- row/col extraction?
- unit tests?