# How do I calculate the acceleration using only 3D distances?

28 views (last 30 days)
lil brain on 15 Apr 2022
Commented: Les Beckham on 18 Apr 2022
Hi,
I have a list of distances in each cell of acc_dist . The first three columns in each cell are xyz coordinates. So column one are all x, column two are all y, and column three are all z. The rows are the coordinate points measured at a speed of 72 Hz.
I am trying to compute the acceleration of these coordinate points by first calculating the 3D euclidean distance between each point and the adjacent point like so:
sqrt((x2-x1).^2+(y2-y1).^2+(z2-z1).^2)
And then I am trying to use the acceleration formula like so:
acceleration = dv/dt
dv = change in velocity
dt = change in time
How would I go about calculating the acceleration for the entire length of each list?
Thank you!
lil brain on 15 Apr 2022
Edited: lil brain on 15 Apr 2022
@Walter Roberson I dont think I follow could you elaborate on that?

Les Beckham on 15 Apr 2022
Edited: Les Beckham on 15 Apr 2022
xyz = cell_of_double_pre_ballsCopy{1};
dxyz = diff(xyz); % difference between adjacent points in xyz coordinates
v = sqrt(dxyz(:,1).^2 + dxyz(:,2).^2 + dxyz(:,3).^2) * 72;
t = 0:1/72:(length(a)-1)/72;
plot(t,v)
plot(t,a)
Les Beckham on 18 Apr 2022
Point taken. Thanks for clarifying.

### Categories

Find more on Standard File Formats 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!

Translated by