How to test if a point is inside of a convex polygon in 2D integer coordinates?

后端 未结 8 711
青春惊慌失措
青春惊慌失措 2020-11-30 04:05

The polygon is given as a list of Vector2I objects (2 dimensional, integer coordinates). How can i test if a given point is inside? All implementations i found on the web fa

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-30 04:28

    The Ray Casting or Winding methods are the most common for this problem. See the Wikipedia article for details.

    Also, Check out this page for a well-documented solution in C.

提交回复
热议问题