`prev Menu next`

PICTURE Definition☆
A PICTURE definition is a variation of a subprogram.
A PICTURE definition can be transformed on invocation.
Use a DRAW statement to invoke a picture.
To define a picture, use EXTERNAL PICTURE, or, internal PICTURE definition syntax.
IF 'tulip' is defined as a picture,
`DRAW tulip`
executes the picture 'tulip'.
Transformation of a picture
DRAW Statements can be provided with a transformation.
Example.
`DRAW tulip WITH SCALE(2)`
executes 'tulip' with the coordinate multiplied by 2.
That is, 'tulip' is enlarged 2 times of center the origin.
Transform functions

SHIFT(a,b) | Moves horizontally a units, vertically b units.
SCALE(a,b) | Enlarges horizontally a times，vertically b times.
SCALE(a) | Enlarges a times of center the origin
ROTATE(a) | Rotates by a of center the origin.
SHEAR(a) | Inclines horizontally by a. That is, (x, y) →(x + y tan a, y)

Composition of Transformations
Transform functions can be composed with *. Composition is made from left to right.
Example.
`DRAW tulip WITH SHIFT(1,0) * SCALE(2)`
Scaling shall be executed after translation.
[Note]
The beam is set off when entering and exiting of a picture definition.
Refer to PLOT LINES

[Note]
Transformation performed by a DRAW statement affects only PLOT, GET, DRAW statements, original enhancements PAINT, FLOOD, and MOUSE POLL.
No other statemets are affected by transformation.

Notification
DRAW statements adjointed WITH transformations are not thread-safe.
That is, if they are executed simultaneously in multiple parallel activities, they happen to be destructive.