SVAngle: CEDAR DEFINITIONS = BEGIN Normalize: PROC [anyRange: REAL] RETURNS [range180: REAL]; Add: PROC [position, increment: REAL] RETURNS [finalPosition: REAL]; ClockwiseAngle: PROC [fromPosition, toPostion: REAL] RETURNS [increment: REAL]; CounterClockwiseAngle: PROC [fromPosition, toPostion: REAL] RETURNS [increment: REAL]; ShortestDifference: PROC [position1, position2: REAL] RETURNS [pos1MinusPos2: REAL]; Scale: PROC [angle: REAL, scalar: REAL] RETURNS [angleTimesScalar: REAL]; ArcTan: PROC [numerator, denominator: REAL] RETURNS [degrees: REAL]; END. $File: SVAngle.mesa Last edited by Bier on June 1, 1984 4:28:17 pm PDT Author: Eric Bier on September 4, 1986 3:33:13 pm PDT Contents: Solidviews requires a precise set of angle operations defined with angle "theta" in the range -180 < theta <= 180. "theta" is an absolute angle (ie a position around the circle measured from the positive x axis). Given two positions angles T1 and T2 we can find the incremental clockwise angle CT between them or the incremental counter-clockwise angle CCT where -360 < CT <= 0 and 0 <= CCT < 360. When we add two angles, we are adding an incremental angle to a position angle to get a new position angle. We subtract two position angles to get an incremental angle. All angles are in degrees. Takes an angle in degrees and puts it in 180 < theta <= 180 form. All angles in degrees All angles in degrees. -360 < increment <= 0 All angles in degrees. 0 <= increment < 360. For example, if the clockwise angle is -90, the counter-clockwise angle will be 270. All angles in degrees. RETURNS ClockwiseAngle or CounterClockwiseAngle. Whichever is smaller. -180< pos1MinusPos2 <= 180. All angles in degrees. Think of angle as the increment from 0 degrees to angle degrees. Scale this and normalize. Has the effect of calling RealFns.ArcTanDegrees and normalizing the result. ΚZ˜Iheadšœ™Jšœ2™2Jšœ5™5Jšœί™ίJ˜Jšœ Οkœ˜Jš˜J˜š Οn œœ œœ œ˜:JšœA™A—š žœœœœœ˜DJšœ™—š žœœœœ œ˜OJšœ,™,—š žœœœœ œ˜VJšœ,™,JšœT™T—J˜š žœœœœœ˜UJšœ{™{—š žœœ œ œœœ˜IJšœr™r—J˜š žœœœœ œ˜DJšœK™K—J˜Jšœ˜—…—:Έ