Skip to content

Commit

Permalink
fix alignment test with plane surface
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaocongAi committed Jul 24, 2024
1 parent 2f46ff1 commit 378f283
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/UnitTests/Core/Surfaces/PlaneSurfaceTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,14 +325,14 @@ BOOST_AUTO_TEST_CASE(PlaneSurfaceAlignment) {
// Get the global position
Vector3 globalPosition =
planeSurfaceObject->localToGlobal(tgContext, localPosition, momentum);

// (a) Test the derivative of path length w.r.t. alignment parameters
const AlignmentToPathMatrix& alignToPath =
planeSurfaceObject->alignmentToPathDerivative(tgContext, globalPosition,
direction);
// The expected results
AlignmentToPathMatrix expAlignToPath = AlignmentToPathMatrix::Zero();
expAlignToPath << 1, 0, 0, 2, -1, -2;
expAlignToPath << 1, 0, 0, 2, -1, 0;

// Check if the calculated derivative is as expected
CHECK_CLOSE_ABS(alignToPath, expAlignToPath, 1e-10);
Expand All @@ -358,9 +358,9 @@ BOOST_AUTO_TEST_CASE(PlaneSurfaceAlignment) {
alignToBound.block<1, 6>(eBoundLoc1, eAlignmentCenter0);
// The expected results
AlignmentToPathMatrix expAlignToloc0;
expAlignToloc0 << 0, 0, 1, 0, 0, 0;
expAlignToloc0 << 0, 0, 1, 0, 0, 2;
AlignmentToPathMatrix expAlignToloc1;
expAlignToloc1 << 0, -1, 0, 0, 0, 0;
expAlignToloc1 << 0, -1, 0, 0, 0, -1;
// Check if the calculated derivatives are as expected
CHECK_CLOSE_ABS(alignToloc0, expAlignToloc0, 1e-10);
CHECK_CLOSE_ABS(alignToloc1, expAlignToloc1, 1e-10);
Expand Down

0 comments on commit 378f283

Please sign in to comment.