Plane.cc
Go to the documentation of this file.
1 
6 #include <cmath>
7 #include <utl/Plane.h>
8 #include <utl/ErrorLogger.h>
9 
10 using namespace utl;
11 
12 
13 Plane::Plane(const Point& anchor, const Vector& normal) :
14  fAnchor(anchor)
15 {
16  const double norm2 = normal.GetMag2();
17  if (norm2) {
18  fNormal = normal;
19  fNormal /= std::sqrt(norm2);
20  } else {
21  fNormal = Vector();
22  ERROR("Plane initialized with invalid normal!");
23  }
24 }
Point object.
Definition: Point.h:32
Plane()=default
Vector fNormal
Definition: Plane.h:27
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.