LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
LineClosestPoint.h
Go to the documentation of this file.
1 
13 #ifndef LARCOREALG_GEOMETRY_LINECLOSESTPOINT_H
14 #define LARCOREALG_GEOMETRY_LINECLOSESTPOINT_H
15 
16 // C++ standard library
17 #include <utility> // std::pair<>
18 
19 // -----------------------------------------------------------------------------
20 namespace geo {
21 
23  template <typename Point>
25 
27  double offset1;
28  double offset2;
29 
31  operator std::tuple<Point&, double&, double&>() noexcept { return {point, offset1, offset2}; }
32 
33  }; // IntersectionPointAndOffsets<>
34 
83  template <typename Point, typename Vector>
85  Vector const& dirA,
86  Point const& startB,
87  Vector const& dirB);
88 
126  template <typename Point, typename Vector>
127  Point LineClosestPoint(Point const& startA,
128  Vector const& dirA,
129  Point const& startB,
130  Vector const& dirB);
131 
174  template <typename Point, typename UnitVector>
176  Point const& startA,
177  UnitVector const& dirA,
178  Point const& startB,
179  UnitVector const& dirB);
180 
227  template <typename Point, typename UnitVector>
229  UnitVector const& dirA,
230  Point const& startB,
231  UnitVector const& dirB);
232 
233 } // namespace geo
234 
235 // -----------------------------------------------------------------------------
236 // --- template implementation
237 // -----------------------------------------------------------------------------
239 
240 // -----------------------------------------------------------------------------
241 
242 #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.
ROOT libraries.
double offset1
Distance from reference point of first line.