Line.cc
Go to the documentation of this file.
1 #include <cmath>
2 #include <utl/Line.h>
3 #include <utl/Plane.h>
4 #include <utl/ErrorLogger.h>
5 
6 using namespace std;
7 using namespace utl;
8 
9 
10 Line::Line(const Point& anchor, const Vector& direction) :
11  fAnchor(anchor)
12 {
13  const double norm2 = direction.GetMag2();
14  if (norm2) {
15  fDirection = direction;
16  fDirection /= sqrt(norm2);
17  } else {
18  ERROR("Line class initialized with invalid direction!");
19  fDirection = Vector();
20  }
21 }
Point object.
Definition: Point.h:32
Vector fDirection
Definition: Line.h:34
Vector object.
Definition: Vector.h:30
#define ERROR(message)
Macro for logging error messages.
Definition: ErrorLogger.h:165
double GetMag2() const
Definition: Vector.h:61

, generated on Tue Sep 26 2023.