# Calculating the velocity (vector) from a 2-Dline

8 views (last 30 days)
tafteh on 22 Jan 2013
Answered: Kubugha Bunonyo on 12 Dec 2016
Hi all I have a line (path) which is drawn by mouse on the screen. The line is 3 column vector [X Y T] where x is the x position along x-axis, y is the y position along Y-axis and T is the time (second) that x,y are registered.
ex. line = [10, 1, 1.2; 12, 2, 1.3; ...]
Since the data (line) is discrete I am confused in calculating the velocity vector. further in calculating the acceleration vector (if needed)
can you help me in resolving this issue?
thanks, P
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

Azzi Abdelmalek on 22 Jan 2013
Edited: Azzi Abdelmalek on 22 Jan 2013
You can calculate the average velocity between two points (x1,y1) and (x2,y2), from time t1 to t2
S=sqrt((x2-x1)^2+(y2-y1)^2)/(t2-t1)
You can, also use interpolation.
##### 3 CommentsShowHide 2 older comments
tafteh on 22 Jan 2013
thanks again, I guess the S=sqrt((x2-x1)^2+(y2-y1)^2)/(t2-t1) should be fine for me now.
cheers,

Sign in to comment.

### More Answers (1)

Kubugha Bunonyo on 12 Dec 2016
What if we are dealing with and image ?
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Categories

Find more on Interpolation 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!