Difference between revisions of "gc:drawPolyLine"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(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...")
 
 
Line 30: Line 30:
  
  
This draws a recatngle (square, actually) whose points are at the given coordinates.
+
This draws a rectangle (square, actually) whose points are at the given coordinates.
 
This code does the same thing as : [[gc:drawRect]](0,0,100,100).
 
This code does the same thing as : [[gc:drawRect]](0,0,100,100).
  
 
<br /><br />
 
<br /><br />
 
[[Category:gc]]
 
[[Category:gc]]

Latest revision as of 12:58, 11 July 2011

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 coordinate pair must be repeated at the end of the array of points to draw a closed polygon.


This has been introduced in TI-Nspire OS 3.0 (Changes).


Syntax

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

Parameter Type Description
x(1)
number x-coordinate of the first point
y(2)
number y-coordinate of the first point
...
numbers x and y coordinates...
x(n)
number x-coordinate of the nth point
y(n)
number y-coordinate of the nth point

Example

gc:drawPolyLine({0,0, 0,100, 100,100, 100,0, 0,0})


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