Showing posts with label astronomy. Show all posts
Showing posts with label astronomy. Show all posts

Saturday, February 24, 2024

Swiss Micros DM42 and HP 42S: Moon Landing Simulator from the HP 33-E Applications Book

Swiss Micros DM42 and HP 42S: Moon Landing Simulator from the HP 33-E Applications Book



Landing the Rocket


The goal is to provide enough fuel to get the rocket to land on the moon safely. The use of fuel pushes the rocket away from the surface and slow down the descent. Don’t crash or use too much fuel to escape into space.


Variables:


X: Position

V: Velocity

F: Fuel

G: Gravity

B: Amount of Fuel to burn


Initial Values (from the HP-33E Applications):

X = 500

V = -50

F = 120

G = 5


I wasn't sure about the win condition (X = 0, V = 0?).


I show the position, velocity, and fuel after each successful turn. Enter the amount of units to burn at the burn prompt.



Download here: https://drive.google.com/file/d/1YsYzIMxALuRx_MHSSzGFFEQJdrN656DS/view?usp=sharing



DM42 and HP 42S Code: MOON


00 { 184-Byte Prgm }

01▸LBL "MOON"

02 500

03 STO "X"

04 -50

05 STO "V"

06 120

07 STO "F"

08 5

09 STO "G"

10▸LBL 01

11 "POS:"

12 ARCL "X"

13 AVIEW

14 STOP

15 "VEL:"

16 ARCL "V"

17 AVIEW

18 STOP

19 "FUEL:"

20 ARCL "F"

21 AVIEW

22 STOP

23 RCL "X"

24 X=0?

25 GTO 07

26▸LBL 02

27 "BURN?"

28 PROMPT

29 STO "B"

30 RCL "F"

31 X<Y?

32 GTO 05

33▸LBL 03

34 RCL "B"

35 STO- "F"

36 RCL- "G"

37 STO "A"

38 RCL "V"

39 RCL+ "X"

40 RCL "A"

41 2

42 ÷

43 +

44 STO "X"

45 X≥0?

46 GTO 04

47 GTO 06

48▸LBL 04

49 RCL "V"

50 RCL+ "A"

51 STO "V"

52 GTO 01

53▸LBL 05

54 2

55 RCL× "G"

56 RCL "V"

57 X↑2

58 +

59 SQRT

60 +/-

61 STO "V"

62▸LBL 06

63 "VEL:"

64 ARCL "V"

65 AVIEW

66 "YOU LOSE"

67 AVIEW

68 RTN

69▸LBL 07

70 "SUCCESS!"

71 AVIEW

72 .END.



Example Game


XEQ "MOON"


Initial Turn

POS: 500

VEL: -50

FUEL: 120


BURN? 0

POS: 447.5

VEL: -55

FUEL: 120


BURN? 0

POS: 390

VEL: -60

FUEL: 120


BURN? 0

POS: 327.5

VEL: -65

FUEL: 120


BURN? 5

POS: 262.5

VEL: -65

FUEL: 115


BURN? 0

POS: 195

VEL: -70

FUEL: 115


BURN? 5

POS: 125

VEL: -70

FUEL: 115


BURN? 10

POS: 57.5

VEL: -65

FUEL: 100


BURN? 12.5

"YOU LOSE" -3.75


So close. Good luck!



Source


HP-33 Applications. Hewlett Packard. Corvallis, OR. February 1978



Eddie


All original content copyright, © 2011-2024. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.

Sunday, January 7, 2024

Casio fx-9750GIII: Equatorial to Galactic Coordinates Conversions

Casio fx-9750GIII: Equatorial to Galactic Coordinates Conversions 



Introduction



Coordinate Systems


There are several coordinate systems used by astronomers to determine the placement of celestial objects, such as stars, galaxies, planets, and black holes, in our night skies.


Two coordinate systems are:



Equatorial System:


The equatorial system frames the University with the Earth's center as the center of the university.  


Right Ascension (α):   Customarily stated in hours, minutes, and seconds (H°M°S°).   Each hour is equivalent to 15 degrees.  The right ascension at 0 hours is aligned where the sun would be during the vernal equinox.  


Declination (δ):   Customarily stated in degrees, minutes, and seconds (D°M°S°).  



Galactic System:


The galactic system frames the University, aligning it with the Milky Way Galaxy.  The center of the system is our Sun.  The galactic longitude at 0 degrees aligns with the center of our galaxy (Sagittarius A*).


Galactic Longitude (l):  Customarily stated in degrees, minutes, and seconds (D°M°S°).  


Galactic Latitude (b):  Customarily stated in degrees, minutes, and seconds (D°M°S°).  



The program EQT2GLT converts equatorial coordinates (α, δ) to galactical coordinates (l, b).  


b = arcsin( cos δ × cos 27.1284° × cos(α - 192.8595°) + cos δ × cos 27.1284° )


l = 

arctan( ( sin δ - sin b × sin 27.1284° ) ÷ ( cos δ × sin(α -192.8595°) × cos 27.1284°) + 32.93117169°

=  atan2((sin δ - sin b × sin 27.1284°), (cos δ × sin(α -192.8595°) × cos 27.1284°)) + 32.93117169°


b is in hours, from -90 to 90 degrees.


l is in degrees, from 0 to 360 degrees.  Be sure to consider quadrants in your calculation.   



The program GLT2EQT converts galactical coordinates (l, b) to equatorial coordinates (α, δ).  


δ = arcsin( (cos b × cos 27.1284° × sin( l - 32.93117169° ) + sin b × sin 27.1284° )


α = arctan( ( cos b × cos( l - 32.93117169° ) ) ÷ ( sin b × cos 27.1284° - cos b × sin 27.1284° × sin( l - 32.93117169° ) ) + 192.8595°

= atan2((cos b × cos(l - 32.93117169°),(sin b × cos 27.1284° - cos b × sin 27.1284° × sin(l-32.93117169°)) + 192.8595°


δ is in degrees, from -90 to 90 degrees.  


α is in hours, from 0 to 24 hours.  Be sure to consider quadrants in your calculation.   Remember that 1 hour is equivalent to 15 degrees.  



The equations are from Practical Astronomy With Your Calculator by Peter Duffett-Smith, with the constants updated for J2000.0.


From the "Conversion of coordinates" page of Tobias Westmeier's webpage, the J2000.0 of the north pole are:


α0 ≈ 192.8595°  (12h 51m 26.28s)

δ0 ≈ 27.1284°  (27°07'42.24")


(Sources:   Duffett-Smith, Westmeier - refer to the Source section)


For more details, please refer to the Equatorial to Galactic Coordinates:  Updating the Constants posted on January 6, 2023.   


Casio fx-9750GIII Program:  EQT2GLT

a+bi
Deg
"EQUATORIAL -> GALACTIC"
"J2000.0"
"R.A. IN H°M°S°"
?->A
"DEC. IN D°M°S°"
?->D
15*A->A
192.8595->R
27.1284->E
32.93117169->C
sin^-1 (cos D*cos E*cos (A-R)+sin D*sin E)->B
sin D-sin B*sin E->Y
cos D*sin (A-R)*cos E->X
Arg (X+Yi)->T
Y<⇒T+360->T
T+C->L
ClrText
"B="
B ▶DMS◢
"L="
L ▶DMS

Note:  The calculator is set to the following modes: degrees, and rectangular complex mode. 

Example:  

The star Hamal in the constellation Aries (Alpha Arietis) is located approximately at:
α = 2 hours, 7 minutes, 10 seconds
δ = 23°27'44"

Enter hours-minutes-seconds and degrees-minutes-seconds by pressing [ OPTN ], [ F6 ] ( > ), [ F5 ] (ANGL), [ F4 ] (°''').

b:  -36°12'22.12"
L:  144°34'33.2"


Casio fx-9750GIII Program:  EQT2GLT

a+bi
Deg
"GALACTIC_->_EQUATORIAL"
"J2000.0"
"B (LAT) IN D°M°S°"
?->B
"L (LONG) IN D°M°S°"
?->L
192.8595->R
27.1284->E
32.93117169->C
sin^-1 (cos B*cos E*sin (L-C)+sin B*sin E)->D
cos B*cos (L-C)->Y
sin B*cos E-cos B*sin E*sin (L-C)->X
Arg (X+Yi)->T
R+T->A
A>360⇒A-360->A
A÷15->A
ClrText
"R.A.="
A ▶DMS◢
"DEC="
D▶DMS

Example:

The star Regulus in the constellation Leo (Alpha Leonis) is located approximately at:  
b:  48°56'03"
l:  226°25'36"

α:  10°08'22.31"  (10 hr, 8 min, 22.31 sec)
δ:  11°58'02.14"

Note:  The results are approximated.  


Sources


"Equatorial coordinate system"  Wikipedia.  Last Edited April 10, 2023.  Accessed December 10, 2023.  https://en.wikipedia.org/wiki/Equatorial_coordinate_system


"Galactic coordinate system" Wikipedia.  Last Edited April 21, 2023.  Accessed November 23, 2023.  https://en.wikipedia.org/wiki/Galactic_coordinate_system


Duffett-Smith, Peter.  Practical Astronomy With Your Calculator  Second Edition.  Cambridge University Press: Cambridge, UK.  1981.  

ISBN: 0 521 28411 2  (paperback) 


National Aeronautics and Space Administration (NASA).   "Coordinate Calculator"  NASA/IPAC Extragalactic Database.  Operated by the California Institute of Technology.  2023.   Accessed November 26, 2023.  https://ned.ipac.caltech.edu/coordinate_calculator?in_csys=Equatorial&in_equinox=J2000.0&obs_epoch=2000.0&ra=17h45m40.036s&dec=-29d00m28.17s&pa=0.0&out_csys=Galactic&out_equinox=J2000.0


Westmeier, Tobias.   "Conversion of coordinates"  Homepage of Tobias Westmeier.  The University of Western Australia.  Last Modified 26 September 2023.   Accessed November 26, 2023.   https://www.atnf.csiro.au/people/Tobias.Westmeier/index.php


Eddie


All original content copyright, © 2011-2024.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Saturday, January 6, 2024

Equatorial to Galactic Coordinates: Updating the Constants

Equatorial to Galactic Coordinates:  Updating the Constants 



Introduction


There are several coordinate systems used by astronomers to determine the placement of celestial objects, such as stars, galaxies, planets, and black holes, in our night skies.   



Equatorial System


The most common system is the Equatorial System.  Imagine a sphere which represents the Universe with the center of the Earth as the center.   The coordinates are the right ascension (α) and the declination (δ).


Right ascension (α):  The right ascension is the angular distance from the vernal equinox, going eastward traveling with the celestial equator. The 0 point is the vernal equinox.   The vernal equinox, which generally takes place around March 20 or 21, is when the sun is over the Earth's equinox heading north.  The lengths of daytime and nighttime are equal.   For the northern hemisphere, it's the first day of spring, and for the southern hemisphere, it's the first day of autumn.  Sometimes, the vernal equinox is called the First Point of Aries (♈).  The range of the right ascension is from 0 hours to 24 hours.   Each hour is equivalent to 15° (15 degrees).


Declination (δ): The declination is the angular distance north (above) or south (below) the celestial equator.  The range of declination is from -90° to +90°.



Galactical System


The galactic coordinate system focuses on aligning with our Milky Way Galaxy, with our Sun as the center of the sphere.  


Galactic Longitude (l):  The galactic longitude measures the angular distance from the center of the Milky Way Galaxy, increasing in the eastward direction.   The range of the galactic longitude is from 0° to 360°, with the 0° point at the Galactic Center, which lies in the constellation Sagittarius the Archer.   (Sagittarius A*)


Galactic Latitude (b):  The galactic latitude is the angle northward from the galactic equator, and it's range is from -90° (south pole located in the constellation Sculptor) to 90° (north pole located in the constellation Coma Berenices).



Practical Astronomy:  With Updated Constants


A popular resource for astronomical calculations is the book Practical Astronomy With Your Calculator by Peter Duffett-Smith.  


On page 48 of Practical Astronomy With Your Calculator, Duffett-Smith provides these equations for converting from equatorial (α, δ) to galactic (l, b) coordinates:


b = arcsin( cos δ × cos 27.4° × cos(α - 192.25°) + cos δ × cos 27.4° )


l = arctan( ( sin δ - sin b × sin 27.4° ) ÷ ( cos δ × sin(α -192.25°) × cos 27.4°) + 33°


Note that in calculation, α, δ, b, and l must be in decimal degrees.   Usually the coordinates are given in hours-minutes-seconds or degrees-minutes-seconds, and the quantities must be converted before calculation.   



The numerical constants?   Those are the 1950.0 coordinates of the north galactic pole with  α0 = 192.25° = 12h 49m and δ = 27.4° = 27°24'.  


Obviously, in 2024, we would be working with the epoch J2000.0 coordinates of the north galactic pole.   If we want to work the J2000.0 coordinates in the above formulas, the constants must be changed.


From the "Conversion of coordinates" page of Tobias Westmeier's webpage, the J2000.0 of the north pole are:


α0 ≈ 192.8595°  (12h 51m 26.28s)

δ0 ≈ 27.1284°  (27°07'42.24")


I choose to use these coordinates because it provides more decimal places than what is presented in the Galactic coordinate page of Wikipedia.


This leaves us with updated equations:


b = arcsin( cos δ × cos 27.1284° × cos(α - 192.8595°) + cos δ × cos 27.1284° )


l = 

arctan( ( sin δ - sin b × sin 27.1284° ) ÷ ( cos δ × sin(α -192.8595°) × cos 27.1284°) + C


We need to determine the value of C.


I'm going to use our galactic center, Sagittarius A*, as a reference point, with the coordinates as determined by NASA/IPAC Extragalactic Database's Coordinator Calculator tool:


Sagittarius A*:


Equatorial Coordinates

α ≈ 266.41681667° (17h 45m 40.036s)

δ ≈ -29.007825° (-29°00'28.17")


Galactic Coordinates

l ≈ 359.94418679°  (359°56'39.072")

b ≈ -0.04610951° (-0°2'45.994")

(Theoretically, this should be l0 = 0°, b0 = 0°).



Substituting the following data into equation for l (only the second equation has C):


l = 

arctan( ( sin δ - sin b × sin 27.1284° ) ÷ ( cos δ × sin(α -192.8595°) × cos 27.1284°) + C


359.94418679°  = 

arctan( ( sin -29.007825°  - sin -0.04610951°  × sin 27.1284° ) ÷ ( cos -29.007825°  × sin(266.41681667° - 192.8595°) × cos 27.1284°) + C



359.94418679°  = arctan( (-0.4845538612°)  ÷ (+0.7465187073°)) + C


We have to keep in mind that anytime we are working with astronomical math, we have to mind the coordinate system.  


359.94418679°  = atan2(0.7465187073°, -0.4845538612°) + C


359.94418679°  = arg(0.7465187073° - 0.4845538612° × i) + C   (where i = √-1)



Note:  


atan2(0.7465187073°, -0.4845538612°) = -32.98698493°


To put this answer in the range of 0° to 360°:


-32.98698493° + 360° = 327.0130151°



359.94418679°  = 327.0130151° + C   


C = 32.93117169



Our final updated equations are:



b = arcsin( cos δ × cos 27.1284° × cos(α - 192.8595°) + cos δ × cos 27.1284° )


l = 

arctan( ( sin δ - sin b × sin 27.1284° ) ÷ ( cos δ × sin(α -192.8595°) × cos 27.1284°) + 32.93117169


and will be used in the programs coming up this weekend.




Sources


"Equatorial coordinate system"  Wikipedia.  Last Edited April 10, 2023.  Accessed December 10, 2023.  https://en.wikipedia.org/wiki/Equatorial_coordinate_system


"Galactic coordinate system" Wikipedia.  Last Edited April 21, 2023.  Accessed November 23, 2023.  https://en.wikipedia.org/wiki/Galactic_coordinate_system


Duffett-Smith, Peter.  Practical Astronomy With Your Calculator  Second Edition.  Cambridge University Press: Cambridge, UK.  1981.  

ISBN: 0 521 28411 2  (paperback) 


National Aeronautics and Space Administration (NASA).   "Coordinate Calculator"  NASA/IPAC Extragalactic Database.  Operated by the California Institute of Technology.  2023.   Accessed November 26, 2023.  https://ned.ipac.caltech.edu/coordinate_calculator?in_csys=Equatorial&in_equinox=J2000.0&obs_epoch=2000.0&ra=17h45m40.036s&dec=-29d00m28.17s&pa=0.0&out_csys=Galactic&out_equinox=J2000.0


Westmeier, Tobias.   "Conversion of coordinates"  Homepage of Tobias Westmeier.  The University of Western Australia.  Last Modified 26 September 2023.   Accessed November 26, 2023.   https://www.atnf.csiro.au/people/Tobias.Westmeier/index.php




Eddie


All original content copyright, © 2011-2024.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, December 17, 2023

HP 15C and HP 71B: Precession of the Equinoxes

HP 15C and HP 71B:   Precession of the Equinoxes



How Far Does the Celestial Object Move?  


Given a celestial object's right ascension (α) and declination (δ), we can calculate the new positions after N years by the formulas presented by The Cambridge Handbook of Physics Formulas (see Source):


α' ≈ α0 + (3.075" + 1.336" × sin α0 × tan δ0) × N


δ' ≈ δ0 + (20.043" × cos α0) × N



Decimal degrees of seconds:


3.075" ≈ 854.1677 × 10^-6


1.336" ≈ 371.1111 × 10^-6


20.043" ≈ 5.5675 × 10^-3



According to the Handbook, the formulas are good for only several centuries, as the formulas are local approximations.  




HP 15C Code:  New Right Ascension (LBL A) and New Declination (LBL D)


Step:  Key Code:  Key



New Right Ascension, α'


001:  42, 21, 11:  LBL A

002:  __, 43, _7:  DEG

003:  __, __, _1:  1

004:  __, __, _3:  3

005:  __, __, _3:  3

006:  __, __, 48:  .

007:  __, __, _6:  6

008:  __, __, 26:  EEX

009:  __, __, _6:  6

010:  __, __, 16:  CHS

011:  __, 43, _2:  →H

012:  __, 45, _1:  RCL 1

013:  __, 43, _2:  →H

014:  __, __, 23:  SIN

015:  __, __, 20:  ×

016:  __, 45, _2:  RCL 2

017:  __, 43, _2:  →H

018:  __, __, 25:  TAN

019:  __, __, 20:  × 

020:  __, __, _3:  3

021:  __, __, _0:  0

022:  __, __, _7:  7

023:  __, __, 48:  .

024:  __, __, _5:  5

025:  __, __, 26:  EEX

026:  __, __, _6:  6

027:  __, __, 16:  CHS

028:  __, 43, _2:  →H

029:  __, __, 40:  +

030:  45, 20, _3:  RCL× 3

031:  __, 45, _1:  RCL 1

032:  __, 43, _2:  →H

033:  __, __, 40:  +

034:  __, 42, _2:  →H.MS

035:  __, 44, _4:  STO 4

036:  __, 43, 32:  RTN


New Declination:  δ'


037:  42, 21, 14:  LBL B

038:  __, 43, _7:  DEG

039:  __, __, _2:  2

040:  __, __, 48:  .

041:  __, __, _0:  0

042:  __, __, _0:  0

043:  __, __, _4:  4

044:  __, __, _3:  3

045:  __, __, 26:  EEX

046:  __, __, _3:  3

047:  __, __, 16:  CHS

048:  __, 43, _2:  →H

049:  __, 45, _1:  RCL 1

050:  __, 43, _2:  →H

051:  __, __, 24:  COS

052:  __, __, 20:  × 

053:  45, 20, _3:  RCL× 3

054:  __, 45, _2:  RCL 2

055:  __, 43, _2:  →H

056:  __, __, 40:  +

057:  __, 42, _2:  →H.MS

058:  __, 44, _5:  STO 5

059:  __, 43, 32:  RTN



Variables Used:


R1 = α0:  Initial Right Ascension (enter in DD.MMSS format)

R2 = δ0:  Initial Declination  (enter in DD.MMSS format)

R3 = N:  Number of Years from 2000.  


Outputs:


R4 = α':  Final Right Ascension (in DD.MMSS format)

R5 = δ':  Final Declination  (in DD.MMSS format)



HP 71B Code:   PRECES


Note:  I had battery problems with the HP 71B, so I'm writing this code from written notes.  


100  DEGREES

110  PRINT "PRECESSION" @ WAIT 0.25

120  PRINT "EPOCH J2000.0"  @ WAIT 0.25

130  INPUT "R.A. °,M,S ?"; H,M,S

140  GOSUB 500 @ A0 = X

150  INPUT "DEC °,M,S? "; H,M,S

160  GOSUB 500 @ D0 = X

170  INPUT "# YEARS? "; N

180  A1 = A0 + (854.1667E-6 + 371.1111E-6 * SIN(A0) * TAN(D0)) * N

190  D1 = D0 + (5.5675E-3 * COS(A0)) * N

200  X = A1 @ GOSUB 600 

210  H1 = H @ M1 = M @ S1 = S @ G1 = G

220  PRINT "R.A. ADJ=" @ WAIT 0.25

230  PRINT G1*H1; "°"; M1; "m"; S1; "s" @ PAUSE

240  X = D1 @ GOSUB 600

250  H2 = H @ M2 = M @ S2 = S @ G2 = G

260  PRINT "DEC ADJ=" @ WAIT 0.25

270  PRINT G2*H2; "°"; M2; "m"; S2; "s"

280  END


500  X=SGN(H) * (ABS(H) + M/60 + S/3600)

510  RETURN


600  G = SGN(X) @ X=ABS(X) @ H=IP(X)

610  M = IP(FP(X) * 60)

620  S = FP(FP(X) * 60) * 60

630  RETURN



Examples



First Point of Aries (Vernal Equinox)


α0 = 0° 00' 00"

δ0 = 0° 00' 00"


N = 100

α' ≈ 5'08" (0.0508)

δ' ≈ 33'24"  (0.3324)



Regulus (Alpha Leonis (Leo))


α0 ≈ 5° 55' 10"

δ0 ≈ 7° 24' 25"


N = 100

α' ≈ 6° 00' 19"

δ' ≈ 7° 57' 39"  


Sagittarius A*  (Center of the Milky Way Galaxy)


α0 ≈ 17° 45' 40"

δ0 ≈ -29° 00' 28"


N = 100

α' ≈ 17° 50' 25"

δ' ≈ -28° 28' 39"  



Betelgeuse (Alpha Orionis (Orion))


α0 ≈ 10° 28' 22"

δ0 ≈ 11° 58' 02"


N = 100

α' ≈ 10° 13' 34"

δ' ≈ 12° 30' 55"  



Source


Woan, Gaham.   The Cambridge Handbook of Physics Formulas  2003 Edition. Cambridge University Press.  2000. ISBN 978-0-511-07589-6



Eddie


All original content copyright, © 2011-2023.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Saturday, April 17, 2021

Fun with the HP 20S (April 17, 2021 Edition)

Fun with the HP 20S (April 17, 2021 Edition)


A Quick Note - Spam Comments 

I noticed that my blog recently had a lot spam comments, especially since the beginning of this year.  Because of this I am considering turning off the ability to leave comments altogether.  If you are going to comment, please be courteous and stay on topic.  No one wants to read the same spam post about off-shore casinos, printers, or scandalous divorce inquiries.

Thank you and now, on with the post.  



Integer Division


The program calculates the quotient and remainder of the division: 


a ÷ b


Instructions:


Enter a, press [ XEQ ] ( F ), enter b.   Get the quotient, press [ R/S ], get the remainder



Program:


01 61,41,F         LBL F

02 21,2 STO 2

03 45        ÷

04 26        R/S

05 21, 1    STO 1

06 74          =

07 21,0      STO 1

08 51,45    IP

09 26          R/S

10 22,0      STO 0

11 61,45    FP

12 55        ×

13 22,1      RCL 1

14 74        =

15 51,33,0         FIX 0

16 61,44    RND   (round)

17 61,34    ALL

18 61,26    RTN



FIX 0, RND, ALL:  round the number in the display to the nearest integer


Examples:


74 ÷ 6  = 12 R 2

Keystrokes:  74, XEQ F, 6, R/S (12) R/S (2)


1576 ÷ 237 = 6 R154


Day Number


This calculates the day number given the month and the date.   A 365-day year is assumed.  


Instructions:

1.  Store month in memory register 1

2.  Store day in memory register 2

3.  Press XEQ A


Program:


01 61,41,A         LBL A

02 22,1      RCL 1

03 31        INPUT

04 2          2

05 61,42    x≤y?

06 51,41,1         GTO 1

07 33          (

08 33        (

09 22,1      RCL 1

10 75        +

11 1          1

12 34          )

13 55        ×

14 3            3

15 0          0

16 73        .

17 6          6

18 34          )

19 51,45    IP

20 65        -

21 6            6

22 3          3

23 74          =

24 21,3      STO 3

25 51,41,2         GTO 2

26 61,41,1         LBL 1

27 33          (

28 33        (

29 22,1      RCL 1

30 65        -

31 1          1

32 34      )

33 55        ×

34 6            6

35 3          3

36 45        ÷

37 2          2

38 34        )

39 51,45    IP

40 74        =

41 21,3      STO 3

42 61,41,2         LBL 2

43 75        +

44 22,2      RCL 2

45 74        =

46 21,3      STO 3

47 61,26    RTN


Examples:


February 16:  2 STO 1, 16 STO 2, XEQ A.  Result:  47

August 22:  8 STO 1, 22 STO 2, XEQ A.   Result:  234


Source:

Duffett-Smith, Peter.  Practical Astronomy With Your Calculator  2nd Ed.  Cambridge University Press: Cambridge.  1979  ISBN 0-521-28411-2


Astronomy:  Geocentric Parallax


The program calculates the quantities ρ sin θ' and ρ cos θ' where:


ρ = distance the observer is from the center of the Earth in meters

θ' = geocentric latitude in degrees


Inputs:


h = height of observer above sea level in meters

L = latitude of the observer in degrees, north is positive


Calculations:


h' = h / 6378140   (estimated radius of Earth is about 6,378 km)

u = atan(0.996647 tan L)

ρ sin θ' = 0.996647 sin u + h' sin L

ρ cos θ' = cos u + h' cos L


Program:


01 61,41,b         LBL B

02 61,23    DEG

03 33          (

04 22,1      RCL 1

05 25        TAN

06 55        ×

07 73        .

08 9          9

09 9          9

10 6            6

11 6          6

12 4          4

13 7          7

14 21,0      STO 0

15 34          )

16 51,25    ATAN

17 21,3      STO 3

18 22,2      RCL 2

19 45        ÷

20 6            6

21 3            3

22 7            7

23 8          8

24 1            1

25 4          4

26 0          0

27 74          =

28 21,4        STO 4

29 22,0      RCL 0

30 55          ×

31 22,3      RCL 1

32 23        SIN

33 75        +

34 21,1      RCL 1

35 23          SIN

36 55            ×

37 22, 4        RCL 4

38 74        =

39 26          R/S

40 22, 3        RCL 3

41 24            COS

42 75          +

43 22, 4      RCL 4

44 55        ×

45 22, 1      RCL 1

46 24          COS

47 74          =

48 61,26      RTN


Registers used:


R1 = L  (input)

R2 = h   (input)

R3 = u

R4 = h / 6378140

R0 = 0.996647


Example:


Input:

L = 45.76° N

h = 53.48 m


54.76 STO 1, 53.48 STO 2, XEQ B

Result:  

ρ sin θ' = .712859241, R/S

ρ cos θ' = .698873028


Source:

Duffett-Smith, Peter.  Practical Astronomy With Your Calculator  2nd Ed.  Cambridge University Press: Cambridge.  1979  ISBN 0-521-28411-2


Eddie

All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 

RPN: DM32 and DM42: Stopping Sight Distance (Metric)

RPN: DM32 and DM42: Stopping Sight Distance (Metric) The Stopping Sight Distance Formula – Derivation The stopping sight di...