Arrays of points for draw functions

Arrays of points

Certain draw functions, such as drawing a polygon, require an array of points. This array may be either two-dimensional or one-dimensional. The following examples, where numpoints represents the number of points used, illustrate this:

1. Two-dimensional array

!temp Points,,i4[2, numpoints]

In an array of this kind, the x co-ordinates of the points are placed in elements [1,1], [1,2] of the array tmp.Points; and so on up to [1, numpoints]; the y co-ordinates are placed in elements [2,1], [2,2]…… [2, numpoints].

2. One-dimensional array

!temp Points,,i4[2 * numpoints]

In an array of this kind, the x co-ordinates are placed in elements [1 to numpoints], and the y co-ordinates in elements [numpoints + 1 to 2 * numpoints). That is, the x co-ordinates go in the first half of the array and the y co-ordinates in the second half.


RELATED TOPICS

Drawing operations