2017-06-28 119 views

回答

2

你也可以調查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 

但一定要檢查頂點和邊緣的例外...