Skip to content

Instantly share code, notes, and snippets.

@martinshaw
Last active September 24, 2023 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinshaw/027babba8d5c42b5eef479d8dc09bd98 to your computer and use it in GitHub Desktop.
Save martinshaw/027babba8d5c42b5eef479d8dc09bd98 to your computer and use it in GitHub Desktop.
f Main <String[] args> {
yield new \GeoChat\GeoServices\Coord <
\FloatUtils\Float _latitude,
\FloatUtils\Float _longitude
>;
f isContainedInPolygon <\GeoChat\GeoServices\Polygon _polygon>{
// Check Contraints
\var rectangularCheck = Reduce <_polygon.points.asArray, Int> (_point, i) => {
\var latCheck = (_point.latitude < @_latitude);
\var longCheck = (_point.longitude < @_longitude)
}
return _polygon.contains <@.asArray> si yes : no;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment