Skip to content
Snippets Groups Projects
Commit f9e386c5 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

add less trivial test for cylinder (accuracy < 2%)

Discover that the promise of 1% accuracy is not kept.
TODO: Replace vertex-based approximation for bottomZ and topZ
of cylinder, cone, ellipsoid etc
parent 50bf70d3
No related branches found
No related tags found
No related merge requests found
...@@ -236,6 +236,12 @@ TEST_F(FormFactorBasicTest, Cylinder) ...@@ -236,6 +236,12 @@ TEST_F(FormFactorBasicTest, Cylinder)
EXPECT_NEAR(-height, particle.bottomZ(RotationY(180*Units::degree)), 1e-13); EXPECT_NEAR(-height, particle.bottomZ(RotationY(180*Units::degree)), 1e-13);
EXPECT_NEAR(0, particle.topZ (RotationY(180*Units::degree)), 1e-13); EXPECT_NEAR(0, particle.topZ (RotationY(180*Units::degree)), 1e-13);
for (double gamma: { 1.123, -2.34, 7.5, -9. })
// 7.5deg is worst case for 24-vertex circle
EXPECT_NEAR(-radius, particle.bottomZ(
RotationEuler(0, 90*Units::degree, gamma*Units::degree)),
3e-2); // TODO decrease epsilon after replacement of vertex-based approximation
test_ff(&particle); test_ff(&particle);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment