GGMeasure.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last edited by Bier on January 28, 1987
Contents: Routines for computing measurements on Gargoyle objects.
DIRECTORY
GGBasicTypes, GGSegmentTypes;
GGMeasure: CEDAR DEFINITIONS =
BEGIN
Point: TYPE = GGBasicTypes.Point;
Segment: TYPE = GGSegmentTypes.Segment;
SlopeOfSegment: PROC [seg: Segment] RETURNS [degrees: REAL];
Returns slope as a positive number in [0..180).
SlopeOfPoints: PROC [p0, p1: Point] RETURNS [degrees: REAL];
CounterClockwiseBetweenSegments: PROC [seg1, seg2: Segment] RETURNS [degreesSeg1ToSeg2: REAL];
SmallestAngleOfPoints: PROC [a, b, c: Point] RETURNS [degreesAngleABC: REAL];
Returns ClockwiseAngle or CounterClockwiseAngle, whichever is smaller. -180 < degreesAngleABC <= 180.
LengthOfSegment: PROC [seg: Segment] RETURNS [lengthInPoints: REAL];
DistanceBetweenPoints: PROC [p0, p1: Point] RETURNS [lengthInPoints: REAL];
DistanceFromPointToSegment: PROC [p: Point, seg: Segment] RETURNS [distanceInPoints: REAL];
DistanceFromPointToLine: PROC [p: Point, p1, p2: Point] RETURNS [distance: REAL];
END.