Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to compute the Normal of a curve at some points?
Date: Fri, 17 Oct 2008 06:11:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 32
Message-ID: <gd9a9q$ij6$1@fred.mathworks.com>
References: <077c6bd3-bc98-4e79-bde3-ca3bb58daad1@a3g2000prm.googlegroups.com> <g607ld$5hr$1@fred.mathworks.com> <gd89hh$rhs$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1224223866 19046 172.30.248.35 (17 Oct 2008 06:11:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 17 Oct 2008 06:11:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:495745


"Karl " <kNsOtSaPhAlM@stanford.edu> wrote in message <gd89hh$rhs$1@fred.mathworks.com>...
> Thanks! This is very helpful. Alas, in trying to follow your derivation, I found the dreaded words: "It can be shown that...".  Can you point me to a reference where the derivation is spelled out step by step?
-------
  First of all, let me apologize for the confusion of notation in that 7/20/08 article.  In the formulas for dx/ds and dy/ds where I used s1 and s2, I meant to use s12 and s23, respectively, as defined by the two previous square root formulas.  I must have been in too much of a hurry at the time.

  With s denoting the (approximate) arc length along the curve, we can call s1, s2, and s3 the (ascending) values of s at the points P1, P2, and P3.  We would then have s12 = s2-s1 and s23 = s3-s2.

  To express x as a quadratic function of s which assumes the values x1, x2, and x3 at the arc length values s1, s2, and s3, we can use the Lagrange interpolation formula

 x = x1*(s-s2)*(s-s3)/(s1-s2)/(s1-s3) + ...
     x2*(s-s1)*(s-s3)/(s2-s1)/(s2-s3) + ...
     x3*(s-s1)*(s-s2)/(s3-s1)/(s3-s2)

If we take the derivative of this x with respect to s and set s equal to s2 to get the derivative at the middle point P2, we get (after a little manipulation):

 dx/ds (at s equal to s2) =
         -x1*(s3-s2)/(s2-s1)/(s3-s1) ...
         -x2*(2*s2-s1-s3)/(s2-s1/(s3-s2) ...
         +x3*(s2-s1)/(s3-s1)/(s3-s2)

       = ((x2-x1)*(s3-s2)^2+(x3-x2)*(s2-s1)^2) / ...
         ((s2-s1)*(s3-s2)*(s3-s1))

       = ((x2-x1)*s23^2+(x3-x2)*s12^2) / ...
         (s12*s23*(s12+s23))

This last is the expression I derived earlier (with s12 and s23 replacing the former confusing s1 and s2.)

  The derivation of dy/ds with y1, y2, and y3 replacing x1, x2, and x3 is done the same way.

Roger Stafford