BEGIN
Point3d: TYPE = ARRAY [1..3] OF REAL;
Vector: TYPE = ARRAY [1..3] OF REAL;
Poly3d: TYPE = REF Poly3dObj;
Poly3dObj:
TYPE =
RECORD [
len: NAT, seq: SEQUENCE maxVerts: NAT OF Point3d];
Plane: TYPE = REF PlaneObj;
PlaneObj:
TYPE =
RECORD [
A, B, C, D: REAL];
Plane equation: Ax + By + Cz + D = 0;
The normal vector is [A, B, C];
The y = 0 plane for instance has A = C = D = 0;
If B = 1 THEN normal is [0, 1, 0] pointing up. Plug in point (4, 5, 6) = 5 (pos, normal side, up).
If B = -1 THEN normal is [0, -1, 0] pointing down. Plug in point (4, 5, 6) = -5 (neg, not normal side, up).