
What ANIMATE does:
It animates a rotation of the figure drawn by DRAW counterclockwise around angle A about the origin, with a “growth” or “shrink” factor C. (If C>1. the drawing increases in size. If C < 1, the drawing shrinks. If C = 1, the drawing size does not change.) So you see picture after picture in an animated sequence. There is a delay D between each two pictures. You set D between 0 (fast) and 10 (slow).| Drawing Program | Explanation |
| PrgmANIMATE | |
:While 1 :For (L,1,D) |
|
| :p2→Z | Computing p2→Z takes a while, and causes a delay. |
| :End | |
| :ClrDraw | Erases screen |
| :C[[cos(A),-sin (A)][sin(A),cos(A)]]*[I] →[I] | Rotates picture by angle A, and changes its size by factor C |
:PrgmDRAW |
Draws a new picture |
| :End |
To run the program, you need [I] and [J]. Also, from the home screen, choose values for A, C, and D. For example,
20!A (rotate by 20 degree angle)
.95!C (this will decrease the size of the picture)
5!D (this will cause an intermediate delay between pictures)
Now choose PrgmANIMATE, and press ENTER.
Some tasks.
Solutions for tasks 3 and 4. (To draw a regular n-gon.)
Modify program ANIMATE by blocking ClrDraw by putting it in quotes:
| Drawing Program | Explanation |
| PrgmANIMATE | |
:While 1 :For (L,1,D) |
|
| :p2→Z | Computing p2→Z takes a while, and causes a delay. |
| :End | |
| :"ClrDraw" | Now it does nothing. |
| :C[[cos(A),-sin (A)][sin(A),cos(A)]]*[I] →[I] | Rotates picture by angle A, and changes its size by factor C |
:PrgmDRAW |
Draws a new picture |
| :End |
Set the variables as follows:
[I] = 10*[[1, cos(360/n)][0, sin(360/n)]]
[J] = [[1][2]]
A = 360/n
C = 1
D = any including 0.
After you interrupt it by [ON][ENTER], just press [GRAPH].
[I] = 10*[[1, cos(k*A)][0, sin(k*A)]]