Equally spaced points along a nonlinear path
Afficher commentaires plus anciens
I have a path linear by parts that I need to equally divide with points. How do I do that?
Réponse acceptée
Plus de réponses (1)
John D'Errico
le 27 Mai 2024
Modifié(e) : John D'Errico
le 27 Mai 2024
Simpler yet, just download my interparc from the file exchange. It allows you to do the operation in a variety of ways, using several variations of spline interpolant, or assuming piecewise linear segments.
It does all the work for you, and it is free.
x = randn(6,1);
y = randn(6,1);
% 500 points, equally spaced along the curve in arclength
Pspline = interparc(500,x,y,'spline');
plot(x,y,'ro',Pspline(:,1),Pspline(:,2),'-')

Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!