Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Numerical calculation about curve length

  1. Sep 2, 2007 #1
    I think I have returned all my math back to teachers without any refund.

    y=f(x);
    h=xb-xa, which is very small.

    My Q is to calculate curve length rather than area numerically.
    But let me use area as example to show you what i want.

    to calculate area between xa to xb, we have 2 ways:
    1) area=(f(xa)+f(xb))*h/2; (trapezoid?)
    2) area=(f(xa)+4*f(xm)+f(xb))*h/6; here xm=(xa+xb)/2; (parabola?)
    As my test, second one is much better than first.

    for curve length:
    1) len=square root( (f(xb)-f(xa))*(f(xb)-f(xa)) + h*h);
    actually, it is distance from (xa, f(xa)) to (xb, f(xb)).

    do you know second way to calculate curve length as in area sample above, simple, easy-to-use and better?

    any links or explainations are highly appreciated.

    thanks.


    .
    .
     
  2. jcsd
  3. Sep 2, 2007 #2

    arildno

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member
    Dearly Missed

    Well, in regions where the curvature is slowly varying, you might interpolate with circular arc segments instead.

    Just a suggestion..
     
  4. Sep 3, 2007 #3

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    Start from an integral representing the length of the curve

    [tex] \int_{x_1}^{x_2} \sqrt{1 + \left(\frac{dy}{dx}\right)^2}\,dx[/tex]

    or [tex] \int_{t_1}^{t_2} \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2\right)}\,dt[/tex] for a curve defined by parametric equations.

    Evaluate the integrals with your favorite numerical formula.
     
  5. Sep 5, 2007 #4
    I just want to know the "favorite numerical formula", if which is better than summing line distances from one point to another.
     
  6. Sep 6, 2007 #5

    HallsofIvy

    User Avatar
    Staff Emeritus
    Science Advisor

    As I said before, in most cases, Simpson's rule is most efficient.
     
  7. Sep 6, 2007 #6
    I like the trapezoidal rule because it does a good enough job for most things and is much less tedious than simpons.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Numerical calculation about curve length
  1. Bezier curve length (Replies: 2)

  2. Length of a curve (Replies: 4)

Loading...