11 #define BOOST_TEST_MODULE LineClosestPoint_test
12 #include <boost/test/unit_test.hpp>
20 #include <type_traits>
34 BOOST_TEST(p.X() == 0.0,
tol);
35 BOOST_TEST(p.Y() == 0.0,
tol);
36 BOOST_TEST(p.Z() == -1.0,
tol);
51 BOOST_TEST(p.X() == 0.0,
tol);
52 BOOST_TEST(p.Y() == 0.0,
tol);
53 BOOST_TEST(p.Z() == 0.0,
tol);
68 BOOST_TEST(
p.X() == 0.0,
tol);
69 BOOST_TEST(
p.Y() == 0.0,
tol);
70 BOOST_TEST(
p.Z() == 0.0,
tol);
71 BOOST_TEST(ofsA == +3.0,
tol);
72 BOOST_TEST(ofsB == -2.0,
tol);
87 BOOST_TEST(
p.X() == 0.0,
tol);
88 BOOST_TEST(
p.Y() == 0.0,
tol);
89 BOOST_TEST(
p.Z() == 0.0,
tol);
90 BOOST_TEST(ofsA == (+3.0 / 2.0),
tol);
91 BOOST_TEST(ofsB == (-2.0 / -2.0),
tol);
106 BOOST_TEST(
p.X() == 0.0,
tol);
107 BOOST_TEST(
p.Y() == 0.0,
tol);
108 BOOST_TEST(
p.Z() == 0.0,
tol);
109 BOOST_TEST(ofsA == (+3.0 / 1.5),
tol);
110 BOOST_TEST(ofsB == (-2.0 / -2.0),
tol);
155 (std::is_same_v<decltype(point),
geo::Point_t>,
"Unexpected point type");
157 (std::is_same_v<decltype(offsetA),
double>,
"Unexpected first offset type");
159 (std::is_same_v<decltype(offsetB),
double>,
"Unexpected second offset type");
161 BOOST_TEST(point.X() == 2.0,
tol);
162 BOOST_TEST(point.Y() == 1.0,
tol);
163 BOOST_TEST(point.Z() == 1.0,
tol);
164 BOOST_TEST(offsetA == 2.0,
tol);
165 BOOST_TEST(offsetB == (2.0/0.866),
tol);
171 point = xsectAndOfs.point;
172 offsetA = xsectAndOfs.offset1;
173 offsetB = xsectAndOfs.offset2;
175 BOOST_TEST(point.X() == 2.0,
tol);
176 BOOST_TEST(point.Y() == 1.0,
tol);
177 BOOST_TEST(point.Z() == 0.0,
tol);
178 BOOST_TEST(offsetA == 2.0/0.866,
tol);
179 BOOST_TEST(offsetB == 2.0,
tol);
187 BOOST_TEST(point.X() == 2.0,
tol);
188 BOOST_TEST(point.Y() == 1.0,
tol);
189 BOOST_TEST(point.Z() == 1.0,
tol);
190 BOOST_TEST(offsetA == 2.0,
tol);
191 BOOST_TEST(offsetB == (2.0/0.866),
tol);
206 BOOST_TEST(p.X() == 0.0,
tol);
207 BOOST_TEST(p.Y() == 0.0,
tol);
208 BOOST_TEST(p.Z() == -1.0,
tol);
223 BOOST_TEST(p.X() == 0.0,
tol);
224 BOOST_TEST(p.Y() == 0.0,
tol);
225 BOOST_TEST(p.Z() == 0.0,
tol);
240 BOOST_TEST(
p.X() == 0.0,
tol);
241 BOOST_TEST(
p.Y() == 0.0,
tol);
242 BOOST_TEST(
p.Z() == 0.0,
tol);
243 BOOST_TEST(ofsA == +3.0,
tol);
244 BOOST_TEST(ofsB == -2.0,
tol);
289 (std::is_same_v<decltype(point),
geo::Point_t>,
"Unexpected point type");
291 (std::is_same_v<decltype(offsetA),
double>,
"Unexpected first offset type");
293 (std::is_same_v<decltype(offsetB),
double>,
"Unexpected second offset type");
295 BOOST_TEST(point.X() == 2.0,
tol);
296 BOOST_TEST(point.Y() == 1.0,
tol);
297 BOOST_TEST(point.Z() == 1.0,
tol);
298 BOOST_TEST(offsetA == 1.0,
tol);
299 BOOST_TEST(offsetB == 2.0,
tol);
305 point = xsectAndOfs.point;
306 offsetA = xsectAndOfs.offset1;
307 offsetB = xsectAndOfs.offset2;
309 BOOST_TEST(point.X() == 2.0,
tol);
310 BOOST_TEST(point.Y() == 1.0,
tol);
311 BOOST_TEST(point.Z() == 0.0,
tol);
312 BOOST_TEST(offsetA == 2.0,
tol);
313 BOOST_TEST(offsetB == 1.0,
tol);
321 BOOST_TEST(point.X() == 2.0,
tol);
322 BOOST_TEST(point.Y() == 1.0,
tol);
323 BOOST_TEST(point.Z() == 1.0,
tol);
324 BOOST_TEST(offsetA == 1.0,
tol);
325 BOOST_TEST(offsetB == 2.0,
tol);
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
void LineClosestPointWithScaledDirs_test()
void LineClosestPointWithUnitVectorsAndOffsets_test()
void LineClosestPointAndOffsetsDocumentation_test()
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
void LineClosestPointSimple45_test()
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsets(Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
Returns the point of a line that is closest to a second line.
void LineClosestPointWithNonHomogeneousDirs_test()
IntersectionPointAndOffsets< Point > LineClosestPointAndOffsetsWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
Definitions of geometry vector data types.
Utility for intersection of two 3D lines.
void LineClosestPointAndOffsetsWithUnitVectorsDocumentation_test()
constexpr Vector Xaxis()
Returns a x axis vector of the specified type.
void LineClosestPointWithUnitVectorsSimple45_test()
Point LineClosestPointWithUnitVectors(Point const &startA, UnitVector const &dirA, Point const &startB, UnitVector const &dirB)
Returns the point of a line that is closest to a second line.
constexpr Vector Zaxis()
Returns a z axis vector of the specified type.
void LineClosestPointSimple_test()
void LineClosestPointWithUnitVectorsSimple_test()
Point LineClosestPoint(Point const &startA, Vector const &dirA, Point const &startB, Vector const &dirB)
Returns the point of a line that is closest to a second line.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
void LineClosestPointAndOffsets_test()
constexpr Point origin()
Returns a origin position with a point of the specified type.