Thread Subject: maxima of curvature

Subject: maxima of curvature

From: Mario

Date: 3 Mar, 2008 11:17:03

Message: 1 of 3

Hi.
I have a list of points describing the outlines points of a
shape. I'd want to find the points of maximum curvature. To
do that I should calculate the tangential angle of each
point on the shape outline ad from these angles I'll
calculate the curvature by differentiation. I was wondering
if there's any matlab function to solve this problem.
Thanks in advance.

Mario

Subject: maxima of curvature

From: Roger Stafford

Date: 3 Mar, 2008 14:20:23

Message: 2 of 3

"Mario " <nospam@yahoo.com> wrote in message <fqgmnf$oin
$1@fred.mathworks.com>...
> Hi.
> I have a list of points describing the outlines points of a
> shape. I'd want to find the points of maximum curvature. To
> do that I should calculate the tangential angle of each
> point on the shape outline ad from these angles I'll
> calculate the curvature by differentiation. I was wondering
> if there's any matlab function to solve this problem.
> Thanks in advance.
>
> Mario
----------
  If your outline points are specified with sufficient accuracy, you can calculate
the curvature of a circumscribing circle through each three successive points
as an approximation to the curvature at the middle of these. That is, if P1,
P2, and P3 are three successive outline points given as two-element row or
column vectors in terms of their x,y coordinates, then do this:

 a = norm(P2-P1); % Distance from P1 to P2
 b = norm(P3-P2); % Distance from P2 to P3
 c = norm(P3-P1); % Distance from P1 to P3
 cv = sqrt((a+b+c)*(b+c-a)*(c+a-b)*(a+b-c))/(a*b*c); % Curvature

Then cv is the curvature (the reciprocal of the radius) of a circle through the
points P1, P2, and P3, and as such constitutes an approximation to the
curvature at the middle point, P2.

  Using this technique avoids the problem of dealing with points where the
slope of the tangent line, dy/dx, becomes very large or infinite.

Roger Stafford

Subject: maxima of curvature

From: Roger Stafford

Date: 3 Mar, 2008 16:13:05

Message: 3 of 3

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in
message <fqh1f7$icm$1@fred.mathworks.com>...
> "Mario " <nospam@yahoo.com> wrote in message <fqgmnf$oin
> $1@fred.mathworks.com>...
> > I have a list of points describing the outlines points of a
> > shape. I'd want to find the points of maximum curvature. .........
> > Mario
> ----------
> ......
> a = norm(P2-P1); % Distance from P1 to P2
> b = norm(P3-P2); % Distance from P2 to P3
> c = norm(P3-P1); % Distance from P1 to P3
> cv = sqrt((a+b+c)*(b+c-a)*(c+a-b)*(a+b-c))/(a*b*c); % Curvature
> .......
---------
  As a better alternative to the formula I gave you earlier, Mario, you can do
the following. Let P1, P2, and P3 be x,y column vectors of three successive
points taken in counterclockwise order around your outline shape. Then the
signed curvature of a circle through them is:

 cv = 2*det([P2-P1,P3-P2])/(norm(P2-P1)*norm((P3-P2)*norm(P3-P1));

(In case the points are represented by row vectors instead of column vectors,
the argument of 'det' should become [P2-P1;P3-P2] so as to remain a 2 x 2
square matrix.)

  This curvature has the advantage that it is positive with convex portions of
the curve and negative with concave portions, (assuming counterclockwise
ordering of the points,) thereby allowing these to be distinguished.

  This method also yields higher accuracy than the earlier one in portions of
the curve where there is very little curvature. That is because with small
curvature the a+b-c quantity in the earlier formula is of the order of the
square of the curvature before the square root operation is performed, and
this fact leads to a loss of accuracy in such cases.

Roger Stafford

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com