curvature of a discrete function
Show older comments
Hello,
I need to compute a curvature of a simple 2D discrete function like this one:
x=1:0.5:20;
y=exp(x);
can anybody help how to do that? thanks
1 Comment
Matt J
on 16 Jan 2013
Your function looks 1D to me.
Accepted Answer
More Answers (2)
Roger Stafford
on 16 Jan 2013
Edited: Bruno Luong
on 13 Mar 2022
Let (x1,y1), (x2,y2), and (x3,y3) be three successive points on your curve. The curvature of a circle drawn through them is simply four times the area of the triangle formed by the three points divided by the product of its three sides. Using the coordinates of the points this is given by:
K = 2*abs((x2-x1).*(y3-y1)-(x3-x1).*(y2-y1)) ./ ...
sqrt(((x2-x1).^2+(y2-y1).^2).*((x3-x1).^2+(y3-y1).^2).*((x3-x2).^2+(y3-y2).^2));
You can consider this as an approximation to the curve's curvature at the middle point of the three points.
2 Comments
Jan
on 16 Jan 2013
+1, I've waited for this answer. See http://www.mathworks.com/matlabcentral/newsreader/view_thread/152405.
Moreno, M.
on 13 Mar 2022
Edited: Jan
on 13 Mar 2022
diff(y,2)./0.5^2
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!