Matlab code for computing curvature equation
46 次查看(过去 30 天)
显示 更早的评论
How can I compute with a code on Matlab the equation of the curvature k=(x' y"-y'x")/(x'^2+y'^2)^3/2 ? I have a relevant number of curves, that I divided into more parts and for each of them I measured the coordinates (x,y). I would like to calculate the curvature for each curve. I thank you very much in advance.
0 个评论
采纳的回答
Roger Stafford
2016-5-14
Your formula for curvature is that of a curve defined in terms of a parameter t in which x’, y’, x”, and y” all refer to derivatives with respect to that parameter. If you have only the x and y coordinates of points on a curve, that formula will not be very useful to you.
If you have confidence in the accuracy of your point coordinates, you can use the formula for the curvature of a circle through three adjacent points on your curve. That would be an approximation for the curvature at the middle point. That formula is: curvature equals four times the area of the triangle formed by the three points divided by the product of the triangle’s three side lengths. Suppose (x1,y1), (x2,y2), and (x3,y3) are the coordinates of three adjacent points on the curve. The computation can go as follows:
a = sqrt((x1-x2)^2+(y1-y2)^2); % The three sides
b = sqrt((x2-x3)^2+(y2-y3)^2);
c = sqrt((x3-x1)^2+(y3-y1)^2);
s = (a+b+c)/2;
A = sqrt(s*(s-a)*(s-b)*(s-c)); % Area of triangle
K = 4*A/(a*b*c); % Curvature of circumscribing circle
3 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!