LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
LineClosestPoint.h
Go to the documentation of this file.
1 
14 #ifndef LARCOREALG_GEOMETRY_LINECLOSESTPOINT_H
15 #define LARCOREALG_GEOMETRY_LINECLOSESTPOINT_H
16 
17 // C++ standard library
18 #include <utility> // std::pair<>
19 
20 // -----------------------------------------------------------------------------
21 namespace geo {
22 
24  template <typename Point>
26 
28  double offset1;
29  double offset2;
30 
32  operator std::tuple<Point&, double&, double&>() noexcept { return {point, offset1, offset2}; }
33 
34  }; // IntersectionPointAndOffsets<>
35 
84  template <typename Point, typename Vector>
86  Vector const& dirA,
87  Point const& startB,
88  Vector const& dirB);
89 
127  template <typename Point, typename Vector>
128  Point LineClosestPoint(Point const& startA,
129  Vector const& dirA,
130  Point const& startB,
131  Vector const& dirB);
132 
175  template <typename Point, typename UnitVector>
177  Point const& startA,
178  UnitVector const& dirA,
179  Point const& startB,
180  UnitVector const& dirB);
181 
228  template <typename Point, typename UnitVector>
230  UnitVector const& dirA,
231  Point const& startB,
232  UnitVector const& dirB);
233 
234 } // namespace geo
235 
236 // -----------------------------------------------------------------------------
237 // --- template implementation
238 // -----------------------------------------------------------------------------
240 
241 // -----------------------------------------------------------------------------
242 
243 #endif // LARCOREALG_GEOMETRY_LINECLOSESTPOINT_H
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.
double offset2
Distance from reference point of second line.
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.
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.
Point point
Intersection point.
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
Definition: DCEL.h:42
Data structure for return values of LineClosestPointAndOffsets().
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.
Namespace collecting geometry-related classes utilities.
double offset1
Distance from reference point of first line.