how to calculate the distance between the two point on the ellipse

edited November 2013 in How To...
                       ***********************************************
                   ***                                                 ***
                **                                                         **
              *                                                               x1
            *                                                                   x
          *                                                                       x
         *                                                                         x                                                                       
         *                                                                         x  
          *                                                                       x
            *                                                                   x
              *                                                               x2
                **                                                         **
                   ***                                                 ***
                       ***********************************************

if i have the equation of ellipse (x/a^2+y/b^2=1),a,b and x’s coordinates is known now,how to calculate the the length of curve between the two point???

Answers

  • edited November 2013

    Why this isn't in the How To category, given the formulation of the subject?... Moved!

    Looks more like a math question (assignment, likely) than a programming question... So that's not about Using Processing at all.

    Perhaps you can use your Internet connection to Google about formulae giving the length of an arc?

  • i found nothing about it and it's true that the problem is about math , but i am an art student , and don't have learn higher mathematics so i hope there's someone on the internet can slove this

  • do points 1 and 2 have the same value of x? i assume they so.

    i'm not sure i trust that equation you posted in the form you have it.

    (x / a) ^ 2 + (y / b) ^ 2 = 1

    so, with some rearranging

    y = b * sqrt(1 - ((x / a)^2))

    so your distance will be twice that...

  • y = b * sqrt(1 - ((x / a)^2))

    I guess that'd be... :-B

    float y = b*sqrt(1 - sq(x/a));
    
  • sorry the value of x for two points doesn't same , and i want to get the distance between them ,witch is shown with the mark 'x'

  • How do you define which points you need? For a given x, you have two points on the ellipse.

  • give the x and y(calculated from the equation of ellipse)

Sign In or Register to comment.