# hp41programs

Curvature &Torsion Ellipsoid Curvature for the HP-41

Overview

"ELK" calculates Gaussian curvature KG & mean curvature KM of an ellipsoid (E):  x2 / a2 + y2 / b2 + z2 / c2 = 1  at a point  M ( x , y , z )

Formulae:

KG = 1 / [ a2 b2 c2  ( x2 / a4 + y2 / b4 + z2 / c4 )2  ]

KM = (1/2) Ñ.n    where   n =  ( x2 / a2 , y2 / b2 , z2 / c2  )  /  ( x2 / a4 + y2 / b4 + z2 / c4 )2        &       Ñ  =   ( ¶/¶x , ¶/¶y , ¶/¶z )       ¶  = partial derivative.

Program Listing

-The semi-axes of the triaxial ellipsoid are to be stored in registers R01-R02-R03

Data Registers:              R00: temp                                        ( Registers R01 thru R03 are to be initialized before executing "ELK" )

•  R01 = a               R04 = x                R07 to R09: temp
•  R02 = b               R05 = y
•  R03 = c               R06 = z
Flags: /
Subroutines:  /

 01 LBL "ELK"  02 STO 04  03 RCL 01  04 X^2  05 /  06 X^2  07 STO 07            08 X<>Y  09 STO 05  10 RCL 02  11 X^2  12 / 13 X^2  14 STO 08  15 +  16 X<>Y  17 STO 06  18 RCL 03            19 X^2  20 /  21 X^2  22 STO 09  23 +  24 STO 00 25 RCL 01  26 RCL 02  27 RCL 03            28 *  29 *  30 *  31 X^2  32 1/X  33 RCL 01  34 X^2  35 1/X  36 ST* 07 37 RCL 02  38 X^2  39 1/X  40 ST* 08  41 RCL 03            42 X^2  43 1/X  44 ST* 09  45 +  46 +  47 RCL 00  48 *  49 RCL 07 50 -  51 RCL 08  52 -  53 RCL 09  54 -  55 RCL 00            56 1.5  57 Y^X  58 /  59 2  60 /  61 X<>Y  62 END

( 75 bytes / SIZE 010 )

 STACK INPUTS OUTPUTS Z z / Y y KM X x KG

Where  KM = mean curvature & KG = Gaussian curvature

Example:    Ellipsoid:   x2 / 49 + y2 / 36 + z2 / 25 = 1      M ( 3.896191634 ,  3.511764224  ,  2.948002121 )

7  STO 01
6  STO 02
5  STO 03

2.948002121   ENTER^
3.511764224   ENTER^
3.896191634   XEQ "ELK"  >>>>     KG = 0.025631779
RDN    KM = 0.163109816

Note:

-"ELK" does not check that M really belongs to (E)

Reference:

[1]  https://mathworld.wolfram.com/Ellipsoid.html