<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.visionaire-tracker.net/index.php?action=history&amp;feed=atom&amp;title=Global_Command%3A_isPointInsidePolygon</id>
		<title>Global Command: isPointInsidePolygon - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.visionaire-tracker.net/index.php?action=history&amp;feed=atom&amp;title=Global_Command%3A_isPointInsidePolygon"/>
		<link rel="alternate" type="text/html" href="https://wiki.visionaire-tracker.net/index.php?title=Global_Command:_isPointInsidePolygon&amp;action=history"/>
		<updated>2026-05-25T16:05:51Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://wiki.visionaire-tracker.net/index.php?title=Global_Command:_isPointInsidePolygon&amp;diff=11877&amp;oldid=prev</id>
		<title>EK: Created page with &quot;Test if a point lies inside a polygon.   == Syntax == &lt;syntaxhighlight lang=&quot;lua&quot;&gt; isPointInsidePolygon(point, polygon) &lt;/syntaxhighlight&gt;   == Parameters ==  {| class=&quot;ts&quot; |-...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.visionaire-tracker.net/index.php?title=Global_Command:_isPointInsidePolygon&amp;diff=11877&amp;oldid=prev"/>
				<updated>2023-05-03T20:54:43Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;Test if a point lies inside a polygon.   == Syntax == &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; isPointInsidePolygon(point, polygon) &amp;lt;/syntaxhighlight&amp;gt;   == Parameters ==  {| class=&amp;quot;ts&amp;quot; |-...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Test if a point lies inside a polygon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
isPointInsidePolygon(point, polygon)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;ts&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:15%&amp;quot; | Parameter&lt;br /&gt;
! style=&amp;quot;width:15%&amp;quot; colspan=&amp;quot;2&amp;quot; | Type/Structure&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | Description&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | point&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | table&lt;br /&gt;
| x (int)&lt;br /&gt;
| style=&amp;quot;width:25%&amp;quot; | Horizontal position (X coordinate)&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | Pass the point as a Visionaire &amp;quot;t_point&amp;quot; field: an associative array containing the elements '''x''' and '''y'''.&lt;br /&gt;
|-&lt;br /&gt;
| y (int)&lt;br /&gt;
| Vertical position (Y coordinate)&lt;br /&gt;
|-&lt;br /&gt;
| polygon&lt;br /&gt;
| table of tables&lt;br /&gt;
| {{x=int,y=int},...} &lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | A single polygon, consisting of a table of Visionaire &amp;quot;t_point&amp;quot; fields. Bear in mind that a field containing multiple polygons (e.&amp;amp;nbsp;g. a way border or object polygon) must be split into single polygons and tested separately. Visionaire uses {-10000,-10000} points (&amp;quot;DIVIDING_POINT&amp;quot; constant) to separate individual polygons from each other in the data structure.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Return values ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;ts&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width:15%&amp;quot; | Type&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| boolean&lt;br /&gt;
| True if the point lies within the polygon.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
'''Example 1:''' Test if the current position of an active &amp;quot;cloud&amp;quot; animation is inside the polygon of a &amp;quot;window&amp;quot; object on the current scene and store the result in a global variable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang =&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local cloudAnim = ActiveAnimations[&amp;quot;cloud&amp;quot;]&lt;br /&gt;
local windowPolygon = game.CurrentScene.Objects[&amp;quot;window&amp;quot;].Polygon&lt;br /&gt;
&lt;br /&gt;
cloudVisible = isPointInsidePolygon(cloudAnim.CurrentPosition, windowPolygon)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{toc}}&lt;/div&gt;</summary>
		<author><name>EK</name></author>	</entry>

	</feed>