Math.InsidePolygon
------------------

Checks if one point is inside a polygon.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Math](component_Math.md) | [2.2](newinversion22.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

### Deprecated

This function was [deprecated](deprecated.md).

MBS( "Math.InsidePolygon"; X; Y; Values ) 

**MBS**( **"Math.InsidePolygon";** /\* Checks if one point is inside a polygon. \*/  
**$X**; /\* The X coordinatee.g. 30 \*/   
**$Y**; /\* The Y coordinatee.g. 30 \*/   
**$Values**) /\* The list of x and y values. Delimiter is semicolon. Numbers in US format.e.g. "10;20;30;20;30;40;10;40 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| X | The X coordinate | 30 |
| Y | The Y coordinate | 30 |
| Values | The list of x and y values. Delimiter is semicolon. Numbers in US format. | "10;20;30;20;30;40;10;40 |

### Description

Checks if one point is inside a polygon.  
### Examples

Check if point is inside polygon:

 $result = MBS ("Math.InsidePolygon"; 30; 30; "10;20;30;20;30;40;10;40")  
Check with GPS coordinates:

 MBS ("Math.InsidePolygon"; 45.787 ; 4.831 ;   
"45.78603562364937 ;4.830036163330078 ;  
45.788691544176785 ;4.830873012542725 ;  
45.78536975331141 ;4.833780527114868 ;  
45.7881753329116 ;4.834917783737183 ”)  
Call with 4 coordinate pairs:

 MBS ("Math.InsidePolygon"; 45.787 ; 4.831 ; $x1 &amp; ";" &amp; $y1 &amp; ";" &amp; $x2 &amp; ";" &amp; $y2 &amp; ";" &amp; $x3 &amp; ";" &amp; $y3 &amp; ";" &amp; $x4 &amp; ";" &amp; $y4 )  
### Release notes

- **Version 7.3**
    - Fixed a bug with [Math.InsidePolygon](http://www.mbsplugins.eu/MathInsidePolygon.shtml).

### Example Databases

- [Math/Polygon test](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Math/Polygon%20test.shtml#1GroupButton60.0000000432.000000079.0000000511.0000000LayoutObjectAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.3pr1](https://www.mbsplugins.de/archive/2017-06-05/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 2.2pr2](https://www.mbsplugins.de/archive/2010-11-06/MBS_Filemaker_Plugin_version_2/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 25th May 2021

  
[Math.InchToPixel](MathInchToPixel.md) - [Math.IsValidCC](MathIsValidCC.md)

[HTML Version](MathInsidePolygon.shtml)