MATLAB Answers

How to find the arclength and radius of curvature for a set of 3D data points?

104 views (last 30 days)
I have a set of 3-D points that represent the coordinates of a curve. I need to find the arclength and radius of curvature of this curve. How might I go about doing this? I've tried fitting the data to a polynomial but it doesn't seem to be working. Please Help!

  5 Comments

Show 2 older comments
Matt J
Matt J on 6 Nov 2018
@Matthew Wong,
If the problem is with the fitting, as John surmises, and not with the actual arclength and curvature calculation, then please go back to your original thread on that topic and pick up the discussion there, adding data and other information as proposed by John.
Matthew Wong
Matthew Wong on 12 Nov 2018
Thanks for the feedback guys! I've attached my data this time. Basically right now I try to break up the data into smaller sections that encompass only one section of the curve so that it better fits a polynomial. Then I use the 'fit' equation to go through and try to fit a polynomial to each section. Then I try to find the arclength of each section (Right now I'm only trying to calculate the arclength, after I get a correct fit for the data I'll move on to radius of curvature).
if true
%Initialize empty arrays and variables to prevent memory overload
syms s x y;
Pts = zeros(100,3);
magnitudes = zeros(99,1);
dx = zeros(99,1);
dy = zeros(99,1);
dz = zeros(99,1);
dscore = zeros(99,1);
magdiff = zeros(99,1);
Sigpts = zeros(100,3);
lowbound = 1;
fitdata=zeros(100,3);
arclength=zeros(100,1);
%Load points into a 100 x 3 array
for j=1:100
Pts(j,1) = xpts(j);
Pts(j,2) = ypts(j);
Pts(j,3) = zpts(j);
end
%Plot the curvature
%plot3(Pts(:,1),Pts(:,2),Pts(:,3));
% grid on;
hold off;
end
Matthew Wong
Matthew Wong on 12 Nov 2018
Update: I had some trouble posting my entire code, but I've attached the MATLAB file above.

Sign in to comment.

Accepted Answer

Are Mjaavatten
Are Mjaavatten on 16 Nov 2018
Edited: Are Mjaavatten on 16 Nov 2018
I was inspired by your question to write a functon that calculates the arc length and curvature of a 1D curve in 2D or 3D space. I believe that does what you want. I submitted it to The Mathworks File Exchange today. You will find it here.

More Answers (0)

Sign in to answer this question.

Products


Release

R2016b