フィルターのクリア

Velocity of moving object at x and y axis

13 ビュー (過去 30 日間)
BlueBee77
BlueBee77 2017 年 4 月 6 日
コメント済み: BlueBee77 2017 年 4 月 6 日
I want to calculate the velocity and acceleration of a moving object. I have the centroid value and i am calculating the distance covered by using euclidean distance formula on current and previous centroid. I am confused on how do we calculate velocity and acceleration of a moving object at x and y-axis. Do we simply divide the euclidean distance formula into x(centroid x) and y(centroid y) parts?
  2 件のコメント
KSSV
KSSV 2017 年 4 月 6 日
Velocity is defined as displacement over time. You have distance now, do you have time?
BlueBee77
BlueBee77 2017 年 4 月 6 日
Yes, i have displacement and time. Just confused on how to get velocity x and velocity y

サインインしてコメントする。

採用された回答

Jan
Jan 2017 年 4 月 6 日
編集済み: Jan 2017 年 4 月 6 日
You can get the velocities in X and Y direction independently.
Vx = gradient(X, TimeStep);
Vy = gradient(Y, TimeStep);
Or:
S = blobCentroid - PrevCent;
V = gradient(S, TimeStep);
Now V contains teh X and Y component.
  3 件のコメント
Jan
Jan 2017 年 4 月 6 日
@BlueBee77: Start with defining, what you want to know: If you want the velocities in X and Y direction separately, you do not need the Euclidean distance. If you want the total velocity independent from the direction, the Euclidean distance will solve this. Or you can calculate the velocities in X and Y direction at first, and then V_total = sqrt(V_x ^ 2 + V_y ^ 2).
It might get clear with an example: The object travels from the point (1, 2) to (2, 4) in 1 time unit h (e.g. seconds, but we can omit the units here). Then:
V_x = (2 - 1) / h = 1
V_y = (4 - 2) / h = 2
V_total = sqrt(1^2 + 2^2) = 2.236
Or you use the Euclidean distance:
V_total = Dist / h = sqrt((2 - 1)^2 + (4 - 2)^2) / h = 2.236
Both calculations are equivalent. In fact, the same numbers appear in the same equations.
BlueBee77
BlueBee77 2017 年 4 月 6 日
@Jan Simon: Thanks alot for such a nice explanation and solving my problem. I need the velocities and acceleration in X and Y direction :)

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2017 年 4 月 6 日
You can use diff(distances) to get "instantaneous" velocity. Then again on velocity to get acceleration. Or use diff(x) and diff(y) to get velocity components along the two directions separately.
  2 件のコメント
BlueBee77
BlueBee77 2017 年 4 月 6 日
編集済み: BlueBee77 2017 年 4 月 6 日
Thanks for your response but how to get the x and y components of displacement??
BlueBee77
BlueBee77 2017 年 4 月 6 日
Can i write it like this for the displacement and then use the for velocity_x and Velocity-y :
d_x= sqrt(x2-x1)^2 and d_y= sqrt(y2-y1)^2 % code

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by