GeometryUtilities.h
Go to the documentation of this file.
1 #ifndef _utl_GeometryUtilities_h_
2 #define _utl_GeometryUtilities_h_
3 
4 #include <utl/Line.h>
5 #include <utl/Plane.h>
6 #include <utl/Vector.h>
7 #include <utl/Point.h>
8 #include <vector>
9 
10 
11 namespace utl {
12 
13  class ReferenceEllipsoid;
14 
15 
28  // intersection
29 
33  Line Intersection(const Plane& p1, const Plane& p2);
34 
35 
39  Point Intersection(const Plane& plane, const Line& line);
40 
41 
45  inline Point Intersection(const Line& line, const Plane& plane)
46  { return Intersection(plane, line); }
47 
48 
52  std::vector<Point> Intersection(const ReferenceEllipsoid&, const double height,
53  const Line& line);
54 
55 
56  // distance
57 
58  inline double Distance(const Point& p1, const Point& p2)
59  { return (p1 - p2).GetMag(); }
60 
61 
65  double Distance(const Line& line1, const Line& line2);
66 
67 
71  double Distance(const Point& point, const Line& line);
72 
73 
77  inline double Distance(const Line& line, const Point& point)
78  { return Distance(point, line); }
79 
80 
84  inline double Distance(const Point& point, const Plane& plane)
85  { return (point - plane.GetAnchor())*plane.GetNormal(); }
86 
87 
91  inline double Distance(const Plane& plane, const Point& point)
92  { return Distance(point, plane); }
93 
94 
95  // projection
96 
100  inline Point PerpendicularProjection(const Point& point, const Plane& plane)
101  { return point - Distance(point, plane)*plane.GetNormal(); }
102 
103 
107  inline Point PerpendicularProjection(const Plane& plane, const Point& point)
108  { return PerpendicularProjection(point, plane); }
109 
110 }
111 
112 
113 #endif
double Plane(const utl::Point &point, const utl::Vector &normal, const utl::Photon &photonIn, utl::Photon &photonOut)
Definition: RTFunctions.cc:41
Point object.
Definition: Point.h:32
const Point & GetAnchor() const
Definition: Plane.h:22
double Distance(const Line &line1, const Line &line2)
Line Intersection(const Plane &p1, const Plane &p2)
Class describing a Plane object.
Definition: Plane.h:17
const Vector & GetNormal() const
Definition: Plane.h:23
Point PerpendicularProjection(const Point &point, const Plane &plane)
Definition: Line.h:17

, generated on Tue Sep 26 2023.