Matlab code for computing curvature equation

조회 수: 18 (최근 30일)
Ipazia
Ipazia 2016년 5월 14일
댓글: rsnandi 2019년 7월 26일
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.

채택된 답변

Roger Stafford
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
Ipazia
Ipazia 2016년 5월 15일
I thank you for your answer. In my data I have also the length of each curve and, since the curves are very short and approach the hypotenuse of the right triangle made by x and y, the tangent vector at the middle point of each curve is almost all the times parallel the the hypotenuse. So I can easily calculate the angle described by t with the x-axis. Is it enough to use that equation or should I use the other you wrote?
rsnandi
rsnandi 2019년 7월 26일
but K is coming complex in my case ....

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by