Fastest way to find the angle between two points

前端 未结 2 1437
梦如初夏
梦如初夏 2021-02-08 10:04

To increase the speed at which I find the sine/cosine of an angle, I have built a reference table instead of calculating them on the fly. I have the same idea with finding the a

2条回答
  •  别跟我提以往
    2021-02-08 10:27

    That's definitely going to be smaller than a call to atan2, since it's a square root and then a linear search through 3600 possibilities. Conversely many processors implement atan2 directly — it's FPATAN in Intel land.

提交回复
热议问题