Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s)
12-10-2019, 11:50 PM (This post was last modified: 12-10-2019 11:55 PM by Gerson W. Barbosa.)
Post: #1
 Gerson W. Barbosa Senior Member Posts: 1,603 Joined: Dec 2013
Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s)
001:LBL  A ; Hypergeometric function –> F(a, b; c; z)
002:STOS  01
003:x⇆  Y
004:/
005:×
006:×
007:RCL  X
008:1
009:STO+  Y
010:x⇆  T
011:⇆  ZTYX
012:INC  04
013:INC  03
014:INC  02
015:INC  Y
016:RCL×  04
017:RCL/  02
018:RCL×  03
019:RCL/  Y
020:RCL×  01
021:RCL  Z
022:R↓
023:STO+  Z
024:⇆  TZXY
025:x≠?  Y
026:BACK  015
027:RTN

028:LBL  B ; Gauss-Kummer –> P = π(a + b)F(-1/2, -1/2; 1; h²)
029:©CONJ ; where h = (a - b)/(a + b)
031:x⇆  Y
033:STO  I
034:/
035:x²
036:#  1/2L
037:+/-
038:RCL  X
039:#  001
040:R↑
041:XEQ  A
042:RCL×  I
043:#  π
044:×  π
045:RTN

046:LBL  C ; Approximation formula using AGM
047:©ENTER; P ~ 2π{a + b - a*b/AGM(a,b) - 2[AGM(a,b) - √(a*b)]}
048:STO+  T
049:RCL×  Y
050:√
051:STO  I
052:x⇆  L
053:⇆  ZYXT
054:AGM
055:STO/  Y
056:RCL-  I
057:STO+  X
058:+
059:-
060:#  π
061:×
062:STO+  X
063:END

Examples:

8 ENTER 9 B -> 53.45328500297187553380768922447455

8 ENTER 9 C -> 53.45328500297(5636)

2 ENTER 3 B -> 15.86543958929058979133166302778306

2 ENTER 3 C -> 15.865439(6104)

Note: if a/b > 3, where a is the semi-major axis, then Cayley’s method (not implemented here) is more efficient. Please refer to this paper for more details:

http://web.tecnico.ulisboa.pt/~mcasquilh...llipse.pdf

——

A couple of hypergeometric function identities:

ln(1 + x) = xF(1, 1; 2; -x)

arcsin(x) = xF(1/2, 1/2; 3/2; x²)

Examples:

1 ENTER ENTER 2 ENTER 0.5 A 0.5 +/- * -> -0.69314718056
2 LN + -> 6e-34

0.5 ENTER ENTER 1.5 ENTER 0.25 A 0.5 * -> 0.5235987756
6 * π - -> 1e-32
 « Next Oldest | Next Newest »

 Messages In This Thread Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 12-10-2019 11:50 PM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Paul Dale - 12-11-2019, 01:47 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 12-13-2019, 04:08 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Ángel Martin - 01-29-2020, 11:44 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Paul Dale - 12-13-2019, 05:04 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 12-13-2019, 05:16 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-11-2020, 01:20 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-14-2020, 05:23 PM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Albert Chan - 01-14-2020, 11:47 PM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-15-2020, 12:59 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-16-2020, 04:18 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-18-2020, 01:14 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - grsbanks - 01-18-2020, 10:25 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-18-2020, 03:41 PM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-21-2020, 09:01 PM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 01-25-2020, 02:53 AM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Paul Dale - 01-29-2020, 12:29 PM RE: Hypergeometric function – Perimeter of an Ellipse and other applications (wp34s) - Gerson W. Barbosa - 02-08-2020, 11:17 PM

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