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

Looking for a metric to express difference between two curves

  1. Jan 11, 2012 #1
    Hi all,

    I am trying to argue that an ellipse is a good approximation for some discontinuity in a material. The ellipse and the interpolated curve I get from the photo look very much alike, but I need an actual number to show how much the two curves differ from each other. I thought of

    [tex]\frac{Area_{actual} - Area_{ellipse}}{Area_{actual}}[/tex]

    but it doesn't really give any information about how much the curves match (a square with the same area as the ellipse would give 0 deviation).

    I'm kind of new to Riemannian geometry, but I thought that maybe I could use the Riemann curvature tensor, although I don't really know how to do it yet :P . I would appreciate any suggestions you are able to give!
  2. jcsd
  3. Jan 11, 2012 #2
    Here is a possibility:

    Let X be the interior of the first curve and let Y be the interior of the second curve. Then you can make

    [tex](X\setminus Y) \cup (Y\setminus X)[/tex]

    The area of that should be a good (pseudo)metric to describe what you want.
  4. Jan 11, 2012 #3
    If the curves can be expressed in polar form [itex](r(\theta), \theta)[/itex], perhaps using as origin of coordinates the center of your suggested ellipse, then maybe you could use
    [tex]\int_{\theta_1}^{\theta_2} (r_{ellipse} - r_{interp})^2 d\theta[/tex]
    (Am I making sense?)
  5. Jan 13, 2012 #4
    Thank you both for your answers!

    Micromass, I really like your suggestion, but I had trouble going from sets to actual equations.

    The solution I used eventually was Dodo's equation: I also looked up "interpolation error".


    There, the deviation of one curve from the other is measured as the square of the distance difference (just as in Dodo's equation).
  6. Jan 13, 2012 #5
    Just a correction: Dodo if I'm not mistaken, your formula is meant to calculate the area between the curves correct? If so, shouldn't it be:

    [tex]|\int_0^{2 \pi}{(r_1(θ)^2-r_2(θ)^2)}{dθ}|[/tex]
  7. Jan 16, 2012 #6
    Hi, Meldraft, sorry for the delay, I was travelling.

    The formula was not intended to calculate the area in-between. I was intended to be a continuous sum (an integral) of squares... just as when you add the squares of residuals after you fit a curve to data. (I couldn't avoid the multiplication by a delta-angle... but I'm open to suggestions.) Hope this makes some sense now.

    Edit: [itex]\theta_1[/itex] and [itex]\theta_2[/itex] are supposed to be the initial and final "sweep angle". Your approximation as an arc of ellipse, when written in polar form, has, as any arc of ellipse, an initial angle and an ending angle. presumably the interpolated curve, if it can be expressed in polar coordinates from the ellipse's center, is also some form of strange arc, with an initial and a final sweep angle.
    Last edited: Jan 16, 2012
  8. Jan 16, 2012 #7
    Ohhh, so you meant like RSS?

    Both my curves are closed, since I'm describing a physical hole, so if I understand correctly, I could use:

    theta1 = 0, theta2 = 2*pi

    I haven't really used this, I'm just familiar with the term, so I'll have to look into it. The area formula (which I am now realising has essentially been micromass' suggestion all along :P) seems to be yielding good results, although I'm a little hesitant on including a self-defined metric. I'd rather use something that is in the literature.

    Thank you for your feedback! I'll let you know how it works out!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook