how can I check that a point is in a triangle?

前端 未结 2 1846
有刺的猬
有刺的猬 2021-01-16 18:17

Hi also consider that I have 4 points and I will have 4 triangles how can I check these four triangles for each point that is the point within the triangles or not. thanks<

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-16 18:46

    Polygon implements the Shape interface, which provides several contains() methods. Here's a simple example.

提交回复
热议问题