(******************************************************************************
*                                PNT3D11 .DEF                                 *
*                              ABO Software Dep.                              *
*                                                                             *
* Purpose : To provide a 3D point definition, and all the simple vector       *
*         operations and constants.                                           *
*                                                                             *
*   Notes : Also included is a routine to write a point to standard io.       *
*                                                                             *
*         Version Date : 22/10/92                                             *
******************************************************************************)
DEFINITION MODULE PNT3D1;

FROM FIO IMPORT File;

TYPE
  Point3D = RECORD
    X   :REAL;
    Y   :REAL;
    Z   :REAL;
  END;

CONST
  ovector = Point3D(0.0, 0.0, 0.0);
  ivector = Point3D(1.0, 0.0, 0.0);
  jvector = Point3D(0.0, 1.0, 0.0);
  kvector = Point3D(0.0, 0.0, 1.0);

PROCEDURE debugp(p1       :Point3D);

PROCEDURE WrPoint3D(f	:File;p	:Point3D);

PROCEDURE RdPoint3D(f	:File):Point3D;

PROCEDURE length(p1      : Point3D):REAL;

PROCEDURE dot (p1,p2     : Point3D):REAL;

PROCEDURE cross(p1,p2    : Point3D):Point3D;

PROCEDURE sub (p1,p2     : Point3D):Point3D;

PROCEDURE add (p1,p2     : Point3D):Point3D;

PROCEDURE neg (p1        : Point3D):Point3D;

PROCEDURE unit(p1        : Point3D):Point3D;

PROCEDURE scale(scale    : REAL;
                p1       : Point3D) :Point3D;

PROCEDURE normal(po,p1,p2:Point3D):Point3D;

PROCEDURE surfacex(
	po,norm: Point3D;
	y,z    : REAL) :REAL;

PROCEDURE surfacey(
	po,norm: Point3D;
	x,z    : REAL) :REAL;

PROCEDURE surfacez(
	po,norm: Point3D;
	x,y    : REAL) :REAL;

END PNT3D1.
