I am currently working on a Physics Engine in C++. The Physics Engine is for a sandbox video game. I want to build a powerful physics engine, so therefore, it needs to be very precise.
I have written the following function:
Vector3D* rotationX(double theta);
This function will rotate a vector around the x-axis at theta degrees. My test attempts to rotate the vector <0,1,0> about the x-axis, which should be the vector <0,0,1>. The output is the following vector, which is very close to what it should be: <0,0.000796327,1>.
I am aware of the floor function, but I think this isn't precise enough since my 3-d vector class should be able to handle real numbers; that is, not just integers.