2D geometry: how to check if a point is inside an angle

前端 未结 4 1073
暗喜
暗喜 2021-02-08 16:58

i have the following geometrical issue in 2D:

i have a point from which i cast an infinite angle (2D-cone) which is given by a direction and an angle. (the point and th

4条回答
  •  执笔经年
    2021-02-08 17:35

    Calculate the angle of the direction using arctg of the direction. Substract the origin from the checked point. Calculate its angle (again via arctg of a normalized vector), and check if it lies within angle boundaries.

提交回复
热议问题