Post Reply 
Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s)
01-25-2020, 02:53 AM
Post: #15
RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s)
(01-21-2020 09:01 PM)Gerson W. Barbosa Wrote:   difference: 477.667 µm

Not even NASA needs to compute the perimeter of an ellipse the shape and dimension of the orbit of Halley’s comet to a precision of less than half a millimeter.
So, in order to minimize program size I’ve worked out another approximation which will give reasonable results when combined with the AGM technique, despite its sloppiness.

p ≈ π(a + b)[(h² + 8)/8]²

where

h = [(a - b)/(a + b)]

Code:


001:LBL A
002:©ENTER
003:×
004:STO I
005:√
006:x⇆ T
007:RCL+ Y
008:R↓
009:AGM
010:STO/ I
011:x⇆ Z 
012:2
013:/
014:RCL+ Y
015:RCL L
016:RCL- Z
017:RCL/ Y
018:x²
019:# 008
020:+ 
021:RCL/ L
022:x²
023:×
024:# π 
025:STO× I
026:×
027:RCL- I
028:STO+ X
029:END

The difference in our usual example is now 122.324 km and the error in the perimeter of the orbit of Pluto is 19.256 fm (femtometer), still beyond any practical requirement. Anyway, the program fits in only 29 steps.

The longer version is now 53 steps long:

Code:

001:LBL A
002:©ENTER
003:×
004:STO 01
005:√
006:x⇆ T
007:RCL+ Y
008:R↓
009:AGM
010:STO/ 01
011:x⇆ Z
012:2
013:/
014:⇆ XYYY
015:STO+ Y
016:©-
017:RCL/ I
018:x²
019:x³
020:STO J
021:x⇆ L
022:FILL
023:# 007
024:× 
025:# 072
026:+ 
027:XEQ 00
028:# 093
029:RCL× J
030:-
031:RCL× I
032:# 104
033:# 017
034:RCL× T
035:-
036:XEQ 00
037:# 007
038:RCL× J
039:+
040:/
041:# π  
042:STO× 01
043:×
044:RCL- 01
045:STO+ X
046:RTN
047:LBL 00
048:RCL× Z
049:# 128
050:- 
051:# 032
052:× 
053:END
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-25-2020 02:53 AM



User(s) browsing this thread: 1 Guest(s)