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

前端 未结 4 987
醉酒成梦
醉酒成梦 2021-02-08 17:15

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:45

    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.

提交回复
热议问题