11 #define BOOST_TEST_MODULE LineClosestPoint_test 13 #include <boost/test/test_tools.hpp> 21 #include <type_traits> 35 BOOST_TEST(p.X() == 0.0,
tol);
36 BOOST_TEST(p.Y() == 0.0,
tol);
37 BOOST_TEST(p.Z() == -1.0,
tol);
52 BOOST_TEST(p.X() == 0.0,
tol);
53 BOOST_TEST(p.Y() == 0.0,
tol);
54 BOOST_TEST(p.Z() == 0.0,
tol);
69 BOOST_TEST(
p.X() == 0.0,
tol);
70 BOOST_TEST(
p.Y() == 0.0,
tol);
71 BOOST_TEST(
p.Z() == 0.0,
tol);
72 BOOST_TEST(ofsA == +3.0,
tol);
73 BOOST_TEST(ofsB == -2.0,
tol);
88 BOOST_TEST(
p.X() == 0.0,
tol);
89 BOOST_TEST(
p.Y() == 0.0,
tol);
90 BOOST_TEST(
p.Z() == 0.0,
tol);
91 BOOST_TEST(ofsA == (+3.0 / 2.0),
tol);
92 BOOST_TEST(ofsB == (-2.0 / -2.0),
tol);
107 BOOST_TEST(
p.X() == 0.0,
tol);
108 BOOST_TEST(
p.Y() == 0.0,
tol);
109 BOOST_TEST(
p.Z() == 0.0,
tol);
110 BOOST_TEST(ofsA == (+3.0 / 1.5),
tol);
111 BOOST_TEST(ofsB == (-2.0 / -2.0),
tol);
156 (std::is_same_v<decltype(point),
geo::Point_t>,
"Unexpected point type");
158 (std::is_same_v<decltype(offsetA),
double>,
"Unexpected first offset type");
160 (std::is_same_v<decltype(offsetB),
double>,
"Unexpected second offset type");
162 BOOST_TEST(point.X() == 2.0,
tol);
163 BOOST_TEST(point.Y() == 1.0,
tol);
164 BOOST_TEST(point.Z() == 1.0,
tol);
165 BOOST_TEST(offsetA == 2.0,
tol);
166 BOOST_TEST(offsetB == (2.0/0.866),
tol);
172 point = xsectAndOfs.point;
173 offsetA = xsectAndOfs.offset1;
174 offsetB = xsectAndOfs.offset2;
176 BOOST_TEST(point.X() == 2.0,
tol);
177 BOOST_TEST(point.Y() == 1.0,
tol);
178 BOOST_TEST(point.Z() == 0.0,
tol);
179 BOOST_TEST(offsetA == 2.0/0.866,
tol);
180 BOOST_TEST(offsetB == 2.0,
tol);
188 BOOST_TEST(point.X() == 2.0,
tol);
189 BOOST_TEST(point.Y() == 1.0,
tol);
190 BOOST_TEST(point.Z() == 1.0,
tol);
191 BOOST_TEST(offsetA == 2.0,
tol);
192 BOOST_TEST(offsetB == (2.0/0.866),
tol);
207 BOOST_TEST(p.X() == 0.0,
tol);
208 BOOST_TEST(p.Y() == 0.0,
tol);
209 BOOST_TEST(p.Z() == -1.0,
tol);
224 BOOST_TEST(p.X() == 0.0,
tol);
225 BOOST_TEST(p.Y() == 0.0,
tol);
226 BOOST_TEST(p.Z() == 0.0,
tol);
241 BOOST_TEST(
p.X() == 0.0,
tol);
242 BOOST_TEST(
p.Y() == 0.0,
tol);
243 BOOST_TEST(
p.Z() == 0.0,
tol);
244 BOOST_TEST(ofsA == +3.0,
tol);
245 BOOST_TEST(ofsB == -2.0,
tol);
290 (std::is_same_v<decltype(point),
geo::Point_t>,
"Unexpected point type");
292 (std::is_same_v<decltype(offsetA),
double>,
"Unexpected first offset type");
294 (std::is_same_v<decltype(offsetB),
double>,
"Unexpected second offset type");
296 BOOST_TEST(point.X() == 2.0,
tol);
297 BOOST_TEST(point.Y() == 1.0,
tol);
298 BOOST_TEST(point.Z() == 1.0,
tol);
299 BOOST_TEST(offsetA == 1.0,
tol);
300 BOOST_TEST(offsetB == 2.0,
tol);
306 point = xsectAndOfs.point;
307 offsetA = xsectAndOfs.offset1;
308 offsetB = xsectAndOfs.offset2;
310 BOOST_TEST(point.X() == 2.0,
tol);
311 BOOST_TEST(point.Y() == 1.0,
tol);
312 BOOST_TEST(point.Z() == 0.0,
tol);
313 BOOST_TEST(offsetA == 2.0,
tol);
314 BOOST_TEST(offsetB == 1.0,
tol);
322 BOOST_TEST(point.X() == 2.0,
tol);
323 BOOST_TEST(point.Y() == 1.0,
tol);
324 BOOST_TEST(point.Z() == 1.0,
tol);
325 BOOST_TEST(offsetA == 1.0,
tol);
326 BOOST_TEST(offsetB == 2.0,
tol);
void LineClosestPointWithScaledDirs_test()
void LineClosestPointWithUnitVectorsAndOffsets_test()
void LineClosestPointAndOffsetsDocumentation_test()
constexpr Vector Yaxis()
Returns a y axis vector of the specified type.
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
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.
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.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
void LineClosestPointSimple_test()
void LineClosestPointWithUnitVectorsSimple_test()
Definitions of geometry vector data types.
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.
void LineClosestPointAndOffsets_test()
BOOST_AUTO_TEST_CASE(LineClosestPointTestCase)
constexpr Point origin()
Returns a origin position with a point of the specified type.