Measuring distance along an ellipse

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

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

The problem arose when I have an angular ellipse and need to find points along it, separated by some "d".

+6
source share
2 answers

The length of a subsection of an ellipse is an elliptic integral without a closed-form solution.

To calculate the distance along the ellipse, you need a numerical integration procedure. I recommend Romberg, or Gauss Quadrature (look at Wikipedia). If you do this repeatedly, then first compare the distance between a bunch of points around the ellipse so that you can quickly get to the desired area, and then start integration.

To find the desired length, you will need to work (find on Wikipedia).

+3
source

There is no analytical solution for the length of an elliptical arc. This means that you cannot connect numbers to the equation to find the result, but use the numerical integration method instead.

The Simpsons rule is very easy to implement, although most likely slower than the methods mentioned in other answers.

Now that you have a way to find the length of the elliptical arc, simply measure the different endpoints until you find one of the lengths d to the allowable tolerance.

0
source

Source: https://habr.com/ru/post/888631/


All Articles