Node: Planes Constructors, Next: , Previous: Planes Global Constants, Up: Plane Reference


void Plane (void) Default constructor
Creates a degenerate Plane with point == normal == origin, and distance == 0.

Planes constructed using this constructor will probably be set using the assignment operator or Path::get_plane() immediately, or very soon after being declared. See Planes Reference; Operators, and Paths Reference; Querying.

void Plane (const Plane& p) Copy constructor
Creates a new Plane, making it a copy of p.

void Plane (const Point& p, const Point& n) Constructor
If p is not equal to n, this constructor creates a Plane and sets point to p. normal is set to n, and made a unit vector. distance is calculated according to the following formula: Let n stand for normal, p for point, and d for distance: d = -p \dot n. If d = 0, origin lies in the Plane. If d > 0, origin lies on the side of the Plane that normal points to, considered to be "outside". If d<0, origin lies on the side of the Plane that normal does not point to, considered to be "inside".

However, if p == n, point and normal are both set to INVALID_POINT, and distance is set to INVALID_REAL, i.e., *this will be equal to INVALID_PLANE (see Planes Reference; Global Constants).

          Point P(1, 1, 1);
          Point N(0, 1);
          N.rotate(-35, 30, 20);
          -| N: (-0.549659, 0.671664, 0.496732)
          Plane q(P, N);
          cout << q.distance;
          -| -0.618736

[Figure 105. Not displayed.]

Fig. 105.