You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
802B

  1. #ifndef LICKS_LINALG_H
  2. #define LICKS_LINALG_H
  3. typedef struct {
  4. double x,y,z;
  5. } vector3d;
  6. typedef struct {
  7. double x[3],y[3],z[3];
  8. } matrix3x3d;
  9. extern void copy_vector3d(vector3d *v1, vector3d *v2);
  10. extern void add_vector3d(vector3d *v1, vector3d *v2, vector3d *result);
  11. extern void sub_vector3d(vector3d *v1, vector3d *v2, vector3d *result);
  12. extern void scalar_mult_vector3d(vector3d *v1, double s, vector3d *result);
  13. extern void cross_mult_vector3d(vector3d *v1, vector3d *v2, vector3d *result);
  14. extern void matrix_mult_vector3d(vector3d *v1, matrix3x3d *M, vector3d *result);
  15. extern void rot_x_vector3d(vector3d *v, double a, vector3d *result);
  16. extern void rot_y_vector3d(vector3d *v, double a, vector3d *result);
  17. extern void rot_z_vector3d(vector3d *v, double a, vector3d *result);
  18. #endif