Plane3d.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Bloomenthal, February 26, 1987 7:06:23 pm PST
DIRECTORY Rope, Vector3d;
Plane3d: CEDAR DEFINITIONS
~ BEGIN
Triple: TYPE ~ Vector3d.Triple;
Quad:  TYPE ~ Vector3d.Quad;
Line:  TYPE ~ Vector3d.Line;
ROPE:  TYPE ~ Rope.ROPE;
Circle: TYPE ~ RECORD [center: Triple, radius: REAL];
Error:  ERROR [code: ATOM, reason: ROPE];
Plane Operations
Normalize: PROC [plane: Quad] RETURNS [Quad];
Return normalized plane (i.e., plane normal is of unit length).
Can raise Error[$NullVec, "null plane normal"].
FromPts: PROC [p1, p2, p3: Triple] RETURNS [Quad];
Return plane passing through three points.
Can raise Error[$NullVec, "points colinear"].
FromPtNrm: PROC [point, normal: Triple] RETURNS [Quad];
Return plane given point on plane and normal to plane.
Can raise Error[$NullVec, "null plane normal"].
IntWithLine: PROC [plane: Quad, line: Line] RETURNS [Triple];
Return intersection point of plane and line given by base and axis.
Can raise Error[$ZeroDiv, "no intersection"].
TriArea: PUBLIC PROC [p0, p1, p2: Triple] RETURNS [REAL];
Return the area of the triangle.
CircleFromPts: PROC [p1, p2, p3: Triple] RETURNS [Circle];
Find center and radius of circle passing through given three points.
Can raise Error[$NullVec, "points collinear"].
IntOf3: PROC [p1, p2, p3: Quad] RETURNS [Triple];
Return point of intersection of planes.
Can raise Error[$ZeroDiv, "no intersection"].
IntOf2: PROC [plane1, plane2: Quad] RETURNS [Line];
Return base and axis of line intersection of planes.
Can raise Error[$NullVec, "no intersection"].
Center: PROC [plane: Quad] RETURNS [Triple];
Return intersection of plane and line from origin normal to plane.
DistanceToPt: PROC [point: Triple, plane: Quad] RETURNS [REAL];
Return the distance from a point to a plane.
Distance is positive if point is in front, negative if behind, plane.
Can raise Error[$NullVec, "null plane normal"].
END.