Determine coordinates for an object at a specific distance and angle from a point

随声附和 提交于 2019-12-08 13:06:28

Given a point A (ax, ay), the coordinates of the point B (bx, by) which is a distance d from A in the direction represented by angle t (where t: - pi < t < + pi and is measured counter clockwise from the positive x direction), would be:

 bx = ax + d*cos(t)
 by = ay + d*sin(t)

I'm not exactly sure if this approach matches your question, as It is not clear from your question what angle yrot represents. But if you determine yrot as simply the angle between the viewer's line of sight to the point B with the positive X-Axis, the above should work.

To cover overrotating, just take the yRot and subtract 2*Pi until the result is between - Pi and +Pi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!