How to calculate the time of a motion

I am working on a project where the cursor on a computer screen moves on a certain path. I have three vectors: x-coordinate, y-coordinate and velocity in each point. Now I need to calculate the time it takes the cursor to finish the path and I have no idea how.
Any help much appreciated.
Thanks :)

Answers (3)

I don’t have your data, but if you have the distance and velocity at each point, finding the time seems straightforward. Am I missing something in the description of your problem?
If you have a parametrization of your path of the form x=x(s),y=y(s) with (x(0),y(0))=startpoint and (x(1),y(1))=endpoint, then
T=integral_{s=0}^{s=1} sqrt((dx/ds)^2+(dy/ds)^2)/u(x(s),y(s)) ds
where u(x(s),y(s)) is the velocity magnitude in the point (x(s),y(s)).
Otherwise, you can approximate the time as a finite sum:
T=sum_{i=1}^{i=N-1} sqrt((x(i+1)-x(i))^2+(y(i+1)-y(i))^2)/(0.5*(u(x(i),y(i))+u(x(i+1),y(i+1))))
Best wishes
Torsten.

1 Comment

This looks promising. I'll try this out. Thank you very much.

Sign in to comment.

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!