Elliptical arc length

Given the point P on the “canonical” ellipse defined by the axes a, b , and the length of the arc s , as I can find the point Q , also on the ellipse, that is, s clockwise along the elliptic curve from P - such that if I started with P and "walked" along the elliptic curve to a distance s , would I have reached Q - programmatically and without breaking the computing bank?

I heard that this can be calculated using some kind of elliptic integration, but I need to make it a bunch and fast. What I'm looking for is an easy to use, computationally inexpensive and fairly accurate approximation method. Or at least a method that is one or two of these things. I will implement this in python.

Edit:, as an alternative, I may need to create a lookup table for position values ​​around ellipses (I may need only the 10th of dissimilar ellipses). How do I do this and what method can I use to populate it?

+4
source share
3 answers

You will need to integrate the ellipse equation. This is actually not difficult.

Take a look at the equations here:

http://mathforum.org/library/drmath/view/51945.html

Since you are using python, integration with Runge-Kutta is implemented for Python (but I do not know it):

http://doswa.com/blog/2009/04/21/improved-rk4-implementation/

Only in steps 3 and 4 of the mathforum solution do you already have a value for ds (arc length) and you want dx.

After finding dx, use step 6 to find y.

+3
source

You can use scipy.special.ellipeinc to calculate arclength lengths. (For more, see Roger Stafford here .)

If this is not fast enough, you can wrap the arclength calculation in a function and use memoize decorator to cache the result of previous (arclength) function calls.

Or, as you already mentioned, you can pre-calculate the values ​​you need and save them in a dict.

+1
source

To solve problems, you need a conjunction: there is a circle in the elipse module
a = 1 that it has the same han elipse perimeter. This is approximately 2πrp.your. the perimeter is then equal to P = 2πrp xa

-1
source

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


All Articles