beautypg.com

Rotate – AMT Datasouth PAL User Manual

Page 165

background image

159

rotate

rotate

Description

Rotates the user coordinate system about the user coordinate system origin.

Usage

AngleNum

rotate

AngleNum

Integer or fixed-point. Number of degrees to rotate the user coordinate system. A
positive angle indicates a counter-clockwise rotation. A negative angle indicates
a clockwise rotation. The programmer should restrict the value to 90 degree
increments in order to ensure proper operation.

Comments

PAL applies the rotation to the current user coordinate system. Therefore, rotations accumulate.
The orders "90 rotate 90 rotate" perform the same function as "180 rotate".

Two approaches exist to using the rotate operator. The first approach works well when designing a
page which contains only a few images rotated differently from the majority of the images. The
second approach works well when drawing a large number of images in a rotated orientation.

The first approach takes advantage of the fact that the rotate operator only affects the operation of
future operators. It does not affect the current point or the points in the current path. Therefore, the
programmer can use the moveto operator to establish the current point using the programmer's
preferred rotation for the majority of the images. After establishing the current point, the
programmer can issue the rotate operator to draw the next image in the alternate rotation. After
PAL has drawn the rotated image, the programmer can issue the negative of the prior rotation to
restore the original drawing and positioning orientation.

The second approach allows the programmer to actually design the page in a rotated orientation.
When using this approach, the programmer will probably wish to combine a translate operation
with any rotate. The following diagrams illustrate the effect of rotating the user coordinate system
without performing an accompanying translate. The small rectangles show the position of the
page in relation to the user coordinate system

0 rotate

+Y

-X

0,0

+X

-Y

180 rotate

-Y

+X

0,0

-X

+Y