Difference between revisions of "gc:fillPolygon"

From Inspired-Lua Wiki
Jump to navigation Jump to search
(Created page with "'''fillPolygon''' 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 1: Line 1:
'''fillPolygon''' is a function that is part of [[:Category:gc|gc]].
+
<p><b>fillPolygon</b> is a function that is part of <a href=":Category:gc">gc</a>.
 
+
</p><p>Fills the polygon defined by the 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.
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.
+
</p><p><br /> <span class="fck_mw_template">{{Since|3.0}}</span>
 
+
</p>
<br /> {{Since|3.0}}
+
<h2>Syntax</h2>
 
+
<p>gc:<b>fillPolygon</b>({x(1), y(2), ..., x(n), y(n)})
==Syntax==
+
</p>
gc:'''fillPolygon'''({x(1), y(2), ..., x(n), y(n)})
+
<table class="wikitable">
 
 
{| 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:fillPolygon({0,0, 0,100, 100,100, 100,0, 0,0})
 
</syntaxhighlight>
 
 
 
  
 +
<tr>
 +
<th> Parameter </th><th> Type </th><th> Description
 +
</th></tr>
 +
<tr>
 +
<td> <u><center>x(1)</center></u> </td><td> number </td><td> x-coordinate of the first point
 +
</td></tr>
 +
<tr>
 +
<td> <u><center>y(2)</center></u> </td><td> number </td><td> y-coordinate of the first point
 +
</td></tr>
 +
<tr>
 +
<td> <u><center>...</center></u> </td><td> numbers </td><td> x and y coordinates...
 +
</td></tr>
 +
<tr>
 +
<td> <u><center>x(n)</center></u> </td><td> number </td><td> x-coordinate of the nth point
 +
</td></tr>
 +
<tr>
 +
<td> <u><center>y(n)</center></u> </td><td> number </td><td> y-coordinate of the nth point
 +
</td></tr>
 +
</table>
 +
<h2> Example </h2>
 +
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="lua source-lua"><pre class="de1"><span class="kw2">gc:fillPolygon</span><span class="br0">&#40;</span><span class="br0">&#123;</span><span class="nu0">0</span>,<span class="nu0">0</span>, <span class="nu0">0</span>,<span class="nu0">100</span>, <span class="nu0">100</span>,<span class="nu0">100</span>, <span class="nu0">100</span>,<span class="nu0">0</span>, <span class="nu0">0</span>,<span class="nu0">0</span><span class="br0">&#125;</span><span class="br0">&#41;</span></pre></div></div>
 +
<p><br />
 
This draws a filled-recatngle (square, actually) whose points are at the given coordinates.
 
This draws a filled-recatngle (square, actually) whose points are at the given coordinates.
 
+
</p><p><br /><br />
<br /><br />
+
</p><a _fcknotitle="true" href="Category:gc">gc</a>
[[Category:gc]]
 

Revision as of 12:54, 11 July 2011

fillPolygon is a function that is part of <a href=":Category:gc">gc</a>.

Fills the polygon defined by the 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:fillPolygon({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

<span class="kw2">gc:fillPolygon</span><span class="br0">(</span><span class="br0">{</span><span class="nu0">0</span>,<span class="nu0">0</span>, <span class="nu0">0</span>,<span class="nu0">100</span>, <span class="nu0">100</span>,<span class="nu0">100</span>, <span class="nu0">100</span>,<span class="nu0">0</span>, <span class="nu0">0</span>,<span class="nu0">0</span><span class="br0">}</span><span class="br0">)</span>


This draws a filled-recatngle (square, actually) whose points are at the given coordinates.



<a _fcknotitle="true" href="Category:gc">gc</a>