DIRECTORY SV2d, SVModelTypes; SVCoordSys2d: CEDAR DEFINITIONS = BEGIN CoordSystem2d: TYPE = REF CoordSystem2dObj; CoordSystem2dObj: TYPE = SVModelTypes.CoordSystem2dObj; Matrix3by3: TYPE = SV2d.Matrix3by3; Point2d: TYPE = SV2d.Point2d; Vector2d: TYPE = SV2d.Vector2d; CreateCoordSys: PROC [mat: Matrix3by3, withRespectTo: CoordSystem2d] RETURNS [newCS: CoordSystem2d]; TellCoordSysAboutPad: PROC [cs: CoordSystem2d]; PadToScreen: PROC [padPoint: Point2d, screen: CoordSystem2d] RETURNS [screenPoint: Point2d]; ScreenToPad: PROC [screenPoint: Point2d, screen: CoordSystem2d] RETURNS [padPoint: Point2d]; FindInTermsOfPad: PROC [cs: CoordSystem2d] RETURNS [mat: Matrix3by3]; FindAinTermsOfB: PROC [a: CoordSystem2d, b: CoordSystem2d] RETURNS [aInTermsOfb: Matrix3by3]; FindTranslationOfAinTermsOfB: PROC [a: CoordSystem2d, b: CoordSystem2d] RETURNS [displacements: Vector2d]; PutAinTermsOfB: PROC [a: CoordSystem2d, b: CoordSystem2d] RETURNS [aInTermsOfb: Matrix3by3]; PlaceAwrtB: PROC [a: CoordSystem2d, b: CoordSystem2d _ NIL, aWRTb: Matrix3by3]; PlaceTranslationAwrtB: PROC [a: CoordSystem2d, b: CoordSystem2d _ NIL, origin: Point2d]; TranslateAwrtB: PROC [a: CoordSystem2d, b: CoordSystem2d _ NIL, tx, ty: REAL]; RotateCCWAwrtB: PROC [a: CoordSystem2d, b: CoordSystem2d _ NIL, degrees: REAL]; AlignAwrtB: PROC [a: CoordSystem2d, b: CoordSystem2d _ NIL]; AbutAwrtB: PROC [a: CoordSystem2d, b: CoordSystem2d _ NIL]; END. ώFile: SVCoordSys2d.mesa Last edited by Bier on January 28, 1987 12:35:17 pm PST Copyright c 1984 by Xerox Corporation. All rights reserved. Contents: Routines for manipulating coordinate systems with respect to each other in 2 dimensions Finds the matrix and redefines CoordSystem a to be in terms of b from now on. Places a in PAD so that the transform from b to a is aWRTb. Updates a with respect to its immediate reference (a.withRespectTo) accordingly. Places a in PAD so that the rotation from a to b remains as it is, but the translation is set to origin. Updates a with respect to its immediate reference (a.withRespectTo) accordingly. Rotate A as little as possible to align its two axes parallel to two of the axes of B (though not necessarily the same two). Equivalent to PlaceTranslationAwrtB where origin = [0, 0] These perform the named transform but do not change the coordinate system with respect to which CoordSystem a is defined. When b is NIL, assumes b = PAD. For local transforms, let b = a. Κ ˜Iheadšœ™Jšœ7™7Jšœ Οmœ1™