Repeat or interpolate an uneven path

Say I have a path consisting of three-dimensional points, where the distance between successive points is not constant.

How to redo it so that the distance between successive points becomes constant?

I tried to look into interp1, but I do not know the starting points of the request for the hypothetically parameterized curve x (t), y (t), z (t).

Example path:

enter image description here

+4
source share
1 answer

interparc Matlab. 100 . - . , . 'linear' ( ).

:

% define some original points
A = [0.132488479262673 0.427113702623907;0.160138248847926 0.462099125364431;0.197004608294931 0.532069970845481;0.236175115207373 0.634110787172012;0.263824884792627 0.677842565597668;0.284562211981567 0.709912536443149;0.307603686635945 0.744897959183673;0.339861751152074 0.785714285714286;0.376728110599078 0.806122448979592;0.40668202764977 0.814868804664723;0.452764976958525 0.817784256559767;0.498847926267281 0.82069970845481;0.521889400921659 0.82069970845481;0.542626728110599 0.82069970845481;0.561059907834101 0.817784256559767;0.579493087557604 0.806122448979592;0.639400921658986 0.759475218658892;0.669354838709677 0.721574344023324;0.713133640552995 0.654518950437318;0.752304147465438 0.581632653061224;0.784562211981567 0.485422740524781;0.793778801843318 0.412536443148688;0.784562211981567 0.316326530612245;0.773041474654378 0.284256559766764;0.754608294930876 0.260932944606414;0.722350230414747 0.231778425655977;0.660138248847926 0.214285714285714;0.567972350230415 0.188046647230321];

% plot original
figure
plot(A(:,1),A(:,2),'*-')

% interpolate
B = interparc(100,A(:,1),A(:,2));             % spline
%B = interparc(100,A(:,1),A(:,2),'linear');   % linear

% plot interpolated
figure
plot(B(:,1),B(:,2),'*-')

: result1_1result1_2

+6

All Articles