Efficiently find points inside a circle sector

前端 未结 3 1171
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 23:02

I have a set of 2d points distributed randomly. I need to perform a time intensive operation on a small subset of these points but I need to first figure out what points I n

3条回答
  •  日久生厌
    2020-11-30 23:51

    I know you don't want trigonometry, but you could convert each point (in your subset) to its polar coordinates (where the origin is your specific point) and threshold r,theta where r < R and T1 < theta < T2 corresponding to the sector. It's certainly memory efficient!

提交回复
热议问题