添加一个向量的位置 [英] Add a vector to a position

查看:208
本文介绍了添加一个向量的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在二维空间中的位置是(A,B),并且有一个方向(在0和360)的一个对象。 我有一个距离,说D. 我想补充D中对象的位置,在该对象望向的方向。

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.

推荐答案

其结果将是:

(X,Y)=(A,B)+ D *(COS(O),罪(O))

(X,Y) = (A,B) + D*(cos(O),sin(O))

编辑:的向量方程等价于:

X = A + D * COS(O)

X = A + D*cos(O)

Y = B + D *罪(O)

Y = B + D*sin(O)

这篇关于添加一个向量的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆