Commit 1b47c85d authored by Kendrick, Coleman's avatar Kendrick, Coleman
Browse files

Added missing 60 deg test

parent 7dc9cebd
......@@ -1062,6 +1062,22 @@ public:
dist = sqrt(pow(height, 2) + pow(base, 2));
TS_ASSERT_DELTA(origin.totalDistInsideObject(), dist, TOLERANCE);
// Test at 60 degrees
BEAM_DIRECTION =
V3D{0.0, sin(60.0 * (M_PI / 180.0)), cos(60.0 * (M_PI / 180.0))};
BEAM_DIRECTION.normalize();
ANGLE = double{atan((BEAM_DIRECTION.Y()) / BEAM_DIRECTION.Z())};
origin = Track(V3D{0., 0., 0.}, BEAM_DIRECTION);
nsegments = cylinder->interceptSurface(origin);
TS_ASSERT_EQUALS(nsegments, 1);
base = origin.totalDistInsideObject() * (BEAM_DIRECTION.Z());
height = base * tan(ANGLE);
dist = sqrt(pow(height, 2) + pow(base, 2));
TS_ASSERT_DELTA(origin.totalDistInsideObject(), dist, TOLERANCE);
}
void testTracksForFlatPlate() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment