Node:Planes Constructors, Next:Planes Operators, Previous:Planes Global Constants, Up:Plane Reference
void Plane (void) | Default constructor |
Creates a degenerate Plane with
point == normal == origin , and
distance == 0.
|
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 P(1, 1, 1); Point N(0, 1); N.rotate(-35, 30, 20); N.show("N:"); -| N: (-0.549659, 0.671664, 0.496732) Plane q(P, N); cout << q.distance; -| -0.618736
|