从向量计算速度 [英] computing velocity from a vector

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

问题描述

我说的主题正确吗?我需要一个公式来计算给定二维矢量的物体的速度.一个对象在x方向上移动+2,在y方向上移动+3.实际上,将x速度和y速度相结合,速度实际有多快?

运动单位并不是真正相关的.它实际上是一个点,该点在表单上的网格正方形上移动.我们可以将其称为每秒像素,但我认为这并不重要.我只需要总速度的公式即可.

我认为它与毕达哥拉斯定理有关,以某种相同的方式测量距离,但我无法弄清楚.我最好的猜测是

Did I phrase the subject right? What I need is a formula to computer the velocity of an object given a two-dimensional vector. An object is going +2 in the x direction and +3 in the y direction. How fast is it actually going with the x speed and y speed combined?

The unit of motion is not really relevant. It''s actually a dot moving across a grid squares on a form. We can call it pixels per second, but I don''t think it matters. I just need the formula for total velocity.

I''m thinking it has to do with the Pythagorean theorem somehow the same way distance is measured, but I can''t figure it out. My best guess is

V = Sqr((x^2) + (y^2))


有人可以帮我确认一下吗?预先感谢.


Can someone confirm that for me? Thanks in advance.

推荐答案

好,您需要相对移动(距离)并将其除以时间:

Sqrt((x-x 0 ) 2 +(y-y 0 ) 2 )/time

根据定义,速度是距离除以时间. :-)

如果在这些轴上投影所有力,坐标,速度和加速度,则始终可以单独考虑所有动力学,例如x和y(希望它们是正交的).

—SA
Well, you need relative move (distance) and divide it by time:

Sqrt((x − x0)2 + (y − y0)2)/time

By definition, speed is a distance divided by time. :-)

You can always consider all the dynamics separately for any orthogonal coordinates like x and y (hope they are orthogonal) if you project all forces, coordinates, speeds and accelerations on these axis.

—SA


由于没有时间分量,因此您正在寻找矢量的大小.您可以按以下方式获取它:
Since there is no time component, you are looking for the magnitude of the vector. You can get it as follows:
M = Math.Sqrt(dx * dx + dy * dy)


"dx"代表"delta x"或向量的x分量. "dy"是"delta y".您可以给定任意两个x点来计算dx:


"dx" stands for "delta x", or the x component of the vector. "dy" is "delta y". You can compute dx given any two x points:

dx = x1 - x2


dy也一样.如果您确实想要速度(而不是速度,因为速度实际上只是速度和方向),则将"M"(幅度)除以行驶该距离所花费的时间.


Same goes for dy. If you really want a speed (not a velocity, as velocity is really just speed and direction), you divide the "M" (magnitude) by the amount of time it took to travel that distance.


这篇关于从向量计算速度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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