Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Measuring distance along ellipse

Suppose we have an ellipse x^2/a^2 + y^2/b^2 .

Taking a point (a*cos(t),b*sint(t)) on the ellipse, what is the fastest way to find another point on the ellipse such that distance between them is a given d. [d is less than pi*a*b].

The problem was encountered when i have a corner [quarter ellipse] and need to find points along it seperated by some 'd'.

like image 650
Anil Shanbhag Avatar asked May 20 '11 10:05

Anil Shanbhag


1 Answers

The length of a subsection of an ellipse is an elliptic integral, with no closed form solution.

In order to compute the distance along the ellipse, you will need a numerical integration routine. I recommend Romberg, or Gauss Quadrature (look up on Wikipedia). If you are doing this repeatedly, then precompute the distance across a bunch of points around the Ellipse so that you can rapidly get to the right region, then start integrating.

You will need to bisect (look up on Wikipedia) to find the desired length.

like image 195
Dov Avatar answered Sep 18 '22 22:09

Dov