# hp41programs

3 celestial bodies

# Smallest Circle Containing 3 Celestial Bodies for the HP-41

Overview

-Given the coordinates of 3 celestial bodies A , B , C, "SMC" returns the diameter ( in deg.mnss )  of the smallest circle containing these bodies.
-There are 2 cases: either the smallest circle is the circle passing through A , B , C  or the diameter is the longest side of the triangle ABC.
-The formulas are given in reference [1], page 127.

Program Listing

-First store the right-ascensions & declinations in registers R01 thru R06. Clear F01.

-Alternatively, you can also store the longitudes & latitudes expressed in sexagesimal degrees ( ° ' " ). In this case, set flag F01

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

•  R01 = R.A1       •  R03 = R.A2       •  R05 = R.A3     (  hh.mnss )        R07 to R12: temp
•  R02 = Decl1      •  R04 = Decl2       •  R06 = Decl3     ( in ° ' " )

Flag:  F01                       CF 01  <->  Equatorial coordinates in hh.mnss
SF 01  <->  Ecliptic coordinates in ° . '  ''
Subroutines: /

 01  LBL "SMC"   02  DEG   03  RCL 01   04  RCL 03    05  HMS-   06  HR   07  7.5   08  FS? 01   09  FRC   10  STO 10    11  *   12  STO 09        13  SIN   14  X^2   15  RCL 02   16  HR   17  COS   18  STO 11   19  *   20  RCL 04   21  HR   22  COS 23  STO 12   24  *   25  RCL 02   26  RCL 04        27  HMS-   28  HR   29  2   30  /   31  STO 08    32  SIN   33  X^2   34  +   35  SQRT   36  ASIN   37  ST+ X   38  STO 07   39  RCL 03   40  RCL 05   41  HMS-   42  HR   43  RCL 10   44  * 45  STO 10   46  SIN   47  X^2   48  RCL 12        49  *   50  RCL 06   51  HR   52  COS   53  STO 12    54  *   55  RCL 04   56  RCL 06   57  HMS-   58  HR   59  2   60  /   61  STO 00   62  SIN   63  X^2   64  +   65  SQRT   66  ASIN 67  ST+ X   68  RCL 09        69  RCL 10   70  +   71  SIN   72  X^2   73  RCL 11   74  *   75  RCL 12    76  *   77  RCL 00   78  RCL 08   79  +   80  SIN   81  X^2   82  +   83  SQRT   84  ASIN   85  ST+ X   86  XY   88  RCL 07 89  XY   91  RDN   92  STO Z         93  X^2   94  X<>Y   95  ST* Z   96  X^2   97  +   98  R^   99  X^2 100  - 101  X<0? 102  CLX 103  X<>Y 104  ST+ X 105  / 106  ACOS 107  SIN 108  / 109  HMS 110  END

( 127 bytes / SIZE 013 )

 STACK INPUT OUTPUT X / D ( ° ' " )

Where D is the diameter of the smallest circle containing the 3 bodies.

Example:       On 1981/09/11 at 0h TT   Mercury , Jupiter and Saturn had the following equatorial coordinates:

R.A1 = 12h41m08s63        R.A2 = 12h52m05s21        R.A3 = 12h39m28s11
Decl1 = -5°37'54"2            Decl2 = -4°22'26"2            Decl3 = -1°50'03"7

12.410863  STO 01      12.520521   STO 03      12.392811   STO 05
-5.37542    STO 02      -4.22262     STO 04       -1.50037     STO 06

-Equatorial coordinates, so  CF 01

XEQ "SMC"  >>>>   D = 4°15'49"11                                     ---Execution time = 10s---

Notes:

-If you are using the ecliptic coordinates ( in ° ' " ), key in  SF 01 before  XEQ "SMC"
-Registers R01 thru R06 are unchanged.

Reference:

[1]  Jean Meeus - "Astronomical Algorithms" - Willmann-Bell  -  ISBN 0-943396-61-1