问题
I have an object in 2D space whose position is (A, B) and which has an orientation (between 0 and 360). I have a distance, say D. I would like to add D to the object's position, in the direction that the object is looking toward.
Mathematically, how would I go about doing that? Thank you.
回答1:
The result would be:
(X,Y) = (A,B) + D*(cos(O),sin(O))
Edit: The vector equation is equivalent to:
X = A + D*cos(O)
Y = B + D*sin(O)
来源:https://stackoverflow.com/questions/22683302/add-a-vector-to-a-position