Added aim test sanity check in raytracer.

Instead of just printing both unit vectors that should be the same,
actually check that they point the same direction with a very
tight tolerance.
This commit is contained in:
Don Cross
2021-12-19 21:33:34 -05:00
parent 70489c3dc6
commit e57dd0a26b

View File

@@ -188,6 +188,13 @@ int JupiterImage(const char *filename, int width, int height, astro_time_t time,
jupiter.y / sph.dist,
jupiter.z / sph.dist);
const double diff = (aimTest - Vector(jupiter.x/sph.dist, jupiter.y/sph.dist, jupiter.z/sph.dist)).Magnitude();
if (diff > 1.0e-15)
{
fprintf(stderr, "FAIL aim test: diff = %le\n", diff);
return 1;
}
scene.SetAimer(&aimer);
scene.SaveImage(filename, (size_t)width, (size_t)height, zoom, 4);