DEFINITION MODULE TwoDthings;

(*------------------------------------------------------------------------*
    Title    :  2D Point and Vector Procedures for Polysys
    LastEdit :  Tue Feb 28 08:31:47 1984
    Author   :  LDS
    Acorn Computers VLSI Design Aids Group
    N.B.     :  Modula2 implementation-dependent. For maximum portability,
                IMPORT Float FROM vFPsupport and change FLOAT to Float in
                the IMPLEMENTATION MODULE.
 *------------------------------------------------------------------------*)
 
EXPORT QUALIFIED  Point, Vector, add, subtract, vector, displace, scale,
                  dot, cross, SamePoint, colinear, distance2, length,
                  inCCWorder, coincident;
 
TYPE     Point =  RECORD
                    x, y : INTEGER;
                  END;
		   
        Vector =  RECORD
                    x, y : INTEGER;
                  END;
 
PROCEDURE add(VAR a, (* to *) b, (* giving *) z : Vector);
PROCEDURE subtract(VAR a, (* from *) b, (* giving *) z : Vector);
PROCEDURE vector(VAR z : Vector;  (* is from *) VAR a,(* to *)b: Point);
PROCEDURE displace(VAR p1 : Point; (* by *) VAR v : Vector;
                               (* giving *) VAR p2 : Point);
PROCEDURE scale(VAR v : Vector;  (* by *) a, (* over *) b : INTEGER);
PROCEDURE dot(VAR v1, v2 : Vector) : INTEGER;
PROCEDURE cross(VAR v1, v2 : Vector) : INTEGER;
PROCEDURE SamePoint(VAR p1, p2 : Point) : BOOLEAN;
PROCEDURE colinear(VAR p1, p2, p3 : Point) : BOOLEAN;
PROCEDURE distance2(VAR p1, p2 : Point) : INTEGER;
PROCEDURE length(VAR v : Vector) : INTEGER;
PROCEDURE inCCWorder(VAR v1, v2, v3 : Vector) : BOOLEAN;
PROCEDURE coincident(VAR v1, v2 : Vector) : BOOLEAN;

END TwoDthings.
