Changes

Jump to navigation Jump to search

gc:drawPolyLine

1,097 bytes added, 13:39, 11 July 2011
Created page with "'''drawPolyLine''' is a function that is part of gc. Draws a series of lines connecting the (x,y) points. The polygon is not automatically closed; the first x-y..."
'''drawPolyLine''' is a function that is part of [[:Category:gc|gc]].

Draws a series of lines connecting the (x,y) points. The polygon is not automatically closed; the first x-y coordinate pair must be repeated at the end of the array of points to draw a closed polygon.

<br /> {{Since|3.0}}

==Syntax==
gc:'''drawPolyLine'''({x(1), y(2), ..., x(n), y(n)})

{| class="wikitable"
|-
! Parameter !! Type !! Description
|-
| <u><center>x(1)</center></u> || number || x-coordinate of the first point
|-
| <u><center>y(2)</center></u> || number || y-coordinate of the first point
|-
| <u><center>...</center></u> || numbers || x and y coordinates...
|-
| <u><center>x(n)</center></u> || number || x-coordinate of the nth point
|-

| <u><center>y(n)</center></u> || number || y-coordinate of the nth point
|-
|}

== Example ==
<syntaxhighlight>gc:drawPolyLine({0,0, 0,100, 100,100, 100,0, 0,0})
</syntaxhighlight>


This draws a recatngle (square, actually) whose points are at the given coordinates.
This code does the same thing as : [[gc:drawRect]](0,0,100,100).

<br /><br />
[[Category:gc]]

Navigation menu