Open antoniogamiz opened 4 years ago
All those functions could be simplified by:
void rotate(vec3& axis, point3& p, const double cos, const double sin)
axis
should be declared as an enum or similar:
enum Axis { x = {1,0,0}, y = {0,1,0}, z = {0,0,1}};
or maybe macros
#define XAXIS {1,0,0}
...
rotate_x
,rotate_y
androtate_z
, can be simplified asrotate(vec3 & axis, const double theta)
where axis is one of{1,0,0}
,{0,1,0}
or{0,0,1}
.