<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164974</link>
    <title>MATLAB Central Newsreader - maxima of curvature</title>
    <description>Feed for thread: maxima of curvature</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Mon, 03 Mar 2008 11:17:03 -0500</pubDate>
      <title>maxima of curvature</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164974#418666</link>
      <author>Mario </author>
      <description>Hi.&lt;br&gt;
I have a list of points describing the outlines points of a&lt;br&gt;
shape. I'd want to find the points of maximum curvature. To&lt;br&gt;
do that I should calculate the tangential angle of each&lt;br&gt;
point on the shape outline ad from these angles I'll&lt;br&gt;
calculate the curvature by differentiation. I was wondering&lt;br&gt;
if there's any matlab function to solve this problem.&lt;br&gt;
Thanks in advance.&lt;br&gt;
&lt;br&gt;
Mario</description>
    </item>
    <item>
      <pubDate>Mon, 03 Mar 2008 14:20:23 -0500</pubDate>
      <title>Re: maxima of curvature</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164974#418696</link>
      <author>Roger Stafford</author>
      <description>&quot;Mario &quot; &amp;lt;nospam@yahoo.com&amp;gt; wrote in message &amp;lt;fqgmnf$oin&lt;br&gt;
$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi.&lt;br&gt;
&amp;gt; I have a list of points describing the outlines points of a&lt;br&gt;
&amp;gt; shape. I'd want to find the points of maximum curvature. To&lt;br&gt;
&amp;gt; do that I should calculate the tangential angle of each&lt;br&gt;
&amp;gt; point on the shape outline ad from these angles I'll&lt;br&gt;
&amp;gt; calculate the curvature by differentiation. I was wondering&lt;br&gt;
&amp;gt; if there's any matlab function to solve this problem.&lt;br&gt;
&amp;gt; Thanks in advance.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Mario&lt;br&gt;
----------&lt;br&gt;
&amp;nbsp;&amp;nbsp;If your outline points are specified with sufficient accuracy, you can calculate &lt;br&gt;
the curvature of a circumscribing circle through each three successive points &lt;br&gt;
as an approximation to the curvature at the middle of these.  That is, if P1, &lt;br&gt;
P2, and P3 are three successive outline points given as two-element row or &lt;br&gt;
column vectors in terms of their x,y coordinates, then do this:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;a = norm(P2-P1); % Distance from P1 to P2&lt;br&gt;
&amp;nbsp;b = norm(P3-P2); % Distance from P2 to P3&lt;br&gt;
&amp;nbsp;c = norm(P3-P1); % Distance from P1 to P3&lt;br&gt;
&amp;nbsp;cv = sqrt((a+b+c)*(b+c-a)*(c+a-b)*(a+b-c))/(a*b*c); % Curvature&lt;br&gt;
&lt;br&gt;
Then cv is the curvature (the reciprocal of the radius) of a circle through the &lt;br&gt;
points P1, P2, and P3, and as such constitutes an approximation to the &lt;br&gt;
curvature at the middle point, P2.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Using this technique avoids the problem of dealing with points where the &lt;br&gt;
slope of the tangent line, dy/dx, becomes very large or infinite.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Mon, 03 Mar 2008 16:13:05 -0500</pubDate>
      <title>Re: maxima of curvature</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/164974#418725</link>
      <author>Roger Stafford</author>
      <description>&quot;Roger Stafford&quot; &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fqh1f7$icm$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Mario &quot; &amp;lt;nospam@yahoo.com&amp;gt; wrote in message &amp;lt;fqgmnf$oin&lt;br&gt;
&amp;gt; $1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have a list of points describing the outlines points of a&lt;br&gt;
&amp;gt; &amp;gt; shape. I'd want to find the points of maximum curvature. .........&lt;br&gt;
&amp;gt; &amp;gt; Mario&lt;br&gt;
&amp;gt; ----------&lt;br&gt;
&amp;gt; ......&lt;br&gt;
&amp;gt;  a = norm(P2-P1); % Distance from P1 to P2&lt;br&gt;
&amp;gt;  b = norm(P3-P2); % Distance from P2 to P3&lt;br&gt;
&amp;gt;  c = norm(P3-P1); % Distance from P1 to P3&lt;br&gt;
&amp;gt;  cv = sqrt((a+b+c)*(b+c-a)*(c+a-b)*(a+b-c))/(a*b*c); % Curvature&lt;br&gt;
&amp;gt; .......&lt;br&gt;
---------&lt;br&gt;
&amp;nbsp;&amp;nbsp;As a better alternative to the formula I gave you earlier, Mario, you can do &lt;br&gt;
the following.  Let P1, P2, and P3 be x,y column vectors of three successive &lt;br&gt;
points taken in counterclockwise order around your outline shape.  Then the &lt;br&gt;
signed curvature of a circle through them is:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;cv = 2*det([P2-P1,P3-P2])/(norm(P2-P1)*norm((P3-P2)*norm(P3-P1));&lt;br&gt;
&lt;br&gt;
(In case the points are represented by row vectors instead of column vectors, &lt;br&gt;
the argument of 'det' should become [P2-P1;P3-P2] so as to remain a 2 x 2 &lt;br&gt;
square matrix.)&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;This curvature has the advantage that it is positive with convex portions of &lt;br&gt;
the curve and negative with concave portions, (assuming counterclockwise &lt;br&gt;
ordering of the points,) thereby allowing these to be distinguished.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;This method also yields higher accuracy than the earlier one in portions of &lt;br&gt;
the curve where there is very little curvature.  That is because with small &lt;br&gt;
curvature the a+b-c quantity in the earlier formula is of the order of the &lt;br&gt;
square of the curvature before the square root operation is performed, and &lt;br&gt;
this fact leads to a loss of accuracy in such cases.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
  </channel>
</rss>

