Perimeter of Ellipse
|
01-19-2020, 11:00 PM
(This post was last modified: 01-20-2020 03:26 PM by Albert Chan.)
Post: #18
|
|||
|
|||
RE: Perimeter of Ellipse
(12-07-2019 07:57 PM)Gerson W. Barbosa Wrote: Just a small refinement – more are still possible – and the overall error in the length of the orbit of Pluto is only 19.34 fm (femtometers!). If you have AGM, this recursive formula is better (based on AGM2 method): \(\large p(a,b) = 2× \left( p({a+b \over 2}, \sqrt{ab}) - {\pi a b \over AGM(a,b)}\right)\) In other words, calculate ellipse perimeter from a much less eccentric ellipse. You can do this recursively, but then you might as well use AGM2. Note: AGM only needed to calculate once, since AGM(a,b) = AGM((a+b)/2, √(ab)) = ... Code: from gmpy2 import * >>> a=mpfr('5906376272') >>> b=mpfr('5720637952.8') >>> print pade22(a,b) 36529672878.015838406030163739762066543303728710139 >>> p = pade22((a+b)/2, sqrt(a*b)) >>> print 2*(p - pi*a*b / agm(a,b)) 36529672878.015838406035141932308423167594568357066 AGM improved pade22 doubled accuracy, from 22 to 45 digits. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)