# Distance along the surface of an oval between two points

• Mar 14th 2009, 02:12 PM
skidx
Distance along the surface of an oval between two points
Hi All...

I am looking for a formula to calculate the distance between 2 points on the outside of an oval.

http://blog.skidzpartz.com/example.gif

I made a small example image.
I have the X,Y value of both A and B.. so in this example they are:
A.x = -1.9
A.y = -2.8
B.x = 2.0
B.y = 2.5

I also have the radius of the oval... we can call R and equals 9.42 (should note I made that up, but I know that the radius of a 6x6 circle)

I am trying to find a way to calculate the distance from A to B clock wise along the surface of the oval, and not necessarily the shorted distance.

I found a formula for calculating the distance for two lat and log and tried to adapt that, but it didn't work... here is what I had:

acos(sin(A.x) * sin(B.x) + cos(A.x) * cos(B.x) * cos(B.y-A.y)) * R

Honestly.. this type of math is above my head, but I really need the answer so I am giving it all I have... been reading up on cos and sin and know its like the x and y of my A and B... but everything I find talks about how to calculate out the angle from the center to get the x and y.. which I already have ....

The formula for the length of part (L) of a curve is $L = \int_a^b \sqrt{1+\left(\frac{dy}{dx}\right)^2}\,dx$
The equation of an oval, more correctly called an ellipse, is $\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$
Rearranging gives $y = \pm \sqrt{b^2 - \frac{b^2x^2}{a^2}}$