Re: 2D maximum curvature
- From: "Roger Stafford" <ellieandrogerxyzzy@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 30 May 2006 20:04:54 -0400
Dorothy Cowie wrote:
----------------------
Dear all
I am trying to find the point of maximum curvature on a 2D curve.
This should be very simple I think! Does anyone have a code for
this?
Many thanks
Dorothy Cowie
If your curve is given by two row vectors, x and y, you can
approximate its curvature at each point by the reciprocal of the
radius of a circumscribing triangle with that point, the preceding
point, and the succeeding point as vertices. The radius of such a
triangle is one fourth the product of the three sides divided by its
area. A zero is appended to the beginning and end of the result to
make it a vector the same length as x and y.
The curvature will be positive for curvature to the left and
negative for curvature to the right as you advance along the curve.
You can get the approximate maximum curvature using the 'max' and
'abs' functions on the 'crv' vector.
x1 = x(1:end-2); x2 = x(2:end-1); x3 = x(3:end);
y1 = y(1:end-2); y2 = y(2:end-1); y3 = y(3:end);
a = sqrt((x3-x2).^2+(y3-y2).^2); % a, b, and c are the three sides
b = sqrt((x1-x3).^2+(y1-y3).^2);
c = sqrt((x2-x1).^2+(y2-y1).^2);
A = 1/2*(x1.*y2+x2.*y3+x3.*y1-x1.*y3-x2.*y1-x3.*y2); % The triangle's
area
crv = [0,4*A./(a.*b.*c),0]; % The reciprocal of its circumscribed
radius
Note that if your data are too closely spaced together or subject
to substantial noise errors, this formula will not be very accurate.
Roger Stafford
.
- References:
- 2D maximum curvature
- From: Dorothy Cowie
- 2D maximum curvature
- Prev by Date: Re: fmincon, find minimum for 3 var constrained eq. help?
- Next by Date: Re: MATLAB for Intel based Macs
- Previous by thread: 2D maximum curvature
- Next by thread: Word Verification
- Index(es):
Relevant Pages
|