MATLAB の inpolygon 的なことをやる

GeometricalPredicates.jl

バージョンがいつまでも v0.x のままだけど…

(@v1.6) pkg> status
 [fd0ad045] GeometricalPredicates v0.4.2

何らかの頂点のデータ(xv,yv)に対して GeometricalPredicates.Point2D という型に変換して更に GeometricalPredicates.Polygon という型のポリゴンを作る.
内側か外側か評価する点(xp,yp)についても, GeometricalPredicates.Point2D という型の変数を使って, inpolygon で判定する.

using GeometricalPredicates
poly = Polygon(Point.(xv,yv)...)
points = Point.(xp,yp)
inside = [inpolygon(poly, p) for p in points]

Front page   Edit Diff Attach Copy Rename Reload   New List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: 2023-11-18 (Sat) 17:39:10 (160d)