home *** CD-ROM | disk | FTP | other *** search
- /*
- * RotateVertices.virx
- * Copyright (c)1992 Bruno Costa & Lucia Darsa
- */
-
- options results
-
- signal on HALT
- signal on SYNTAX
- signal on FAILURE
-
- call openmath
-
- lockgui
-
- form = '"BOOL,TO Window,0|' ||,
- 'STR,Angle:,10.0,6"'
-
- requestform TITLE '"Rotate Vertices"' form
- if rc >= 5 then
- signal halt
-
- parse var result window '|' theta
- pi = 3.14159
- thetar = ((-theta) * pi) / 180
- costheta = cos(thetar)
- sintheta = sin(thetar)
-
- if window = 0 then
- winname = 'FROM'
- else
- winname = 'TO'
-
- getcenterselected winname
- parse var result cx cy
-
- transformpoints winname costheta (-sintheta) (cx - cx * costheta + cy * sintheta),
- sintheta costheta (cy - cy * costheta - cx * sintheta),
- 0 0 1
-
- unlockgui
- exit 0
-
- /* add rexxmathlib.library if it is not already open */
- openmath: procedure
- if ~show('L', "rexxmathlib.library") then do
- if ~addlib("rexxmathlib.library", 0, -30, 0) then do
- requestnotify "could not open rexxmathlib.library"
- exit 20
- end
- end
- return
-
- BREAK_C:
- HALT:
- unlockgui
- exit 20
-
- FAILURE:
- requestnotify '"Host *"'address()'*" returned an error (severity 'rc')*nexecuting' compress(sourceline(2),'* ') 'at line' SIGL'"'
- unlockgui
- exit 20
-
- SYNTAX:
- requestnotify '"'errortext(rc)'*nexecuting' compress(sourceline(2),'* ') 'at line' SIGL'"'
- unlockgui
- exit 20
-