Reputation: 1664
Is there such function in Julia?
Desperately trying to migrate to Julia from MATLAB, but still finding myself dependent on it...
Upvotes: 2
Views: 1241
Reputation: 531
The PolygonOps
package does point-in-polygon testing too.
It's more user-friendly, but possibly slower, than GeometricalPredicates
.
(Hat tip: Julia forum.)
Upvotes: 0
Reputation: 2707
You could also investigate Luxor.jl:
using Luxor
p1 = Point(0, 0)
p2 = Point(10, 0)
p3 = Point(10, 10)
p4 = Point(0, 10)
isinside(Point(5, 5), [p1, p2, p3, p4]) # true
isinside(Point(15, 5), [p1, p2, p3, p4]) # false
But make sure to check for vertex and edge exceptions...
Upvotes: 3
Reputation: 3207
The GeometricalPredicates package has inpolygon
: https://github.com/JuliaGeometry/GeometricalPredicates.jl
Upvotes: 10