I have previously written a program to calculate binary star orbits using the algorithm given in Practical Astronomy with your Calculator by Peter Duffet-Smith. I wrote the code for a programmable calculator (a Casio fx-4500P) and it makes predicting the positions of binary stars fairly straight forward. Recently I had been thinking it would be useful to have some code that could calculate the angular separation of any two stars (or any two celestial objects) as this is something that is always cropping up. For example, in May last year I took a photograph of the double star Mizar and Alcor and I used their angular separation to determine the resolution of my camera (in arc seconds per pixel) when it was at the prime focus of my Orion OMC-140 telescope.
So now I have used another algorithm in Peter's book to write some code for the Casio to do this (see section (31) on page 52). It is based on knowing the equatorial coordinates of the two objects (in other words their Right Ascension and Declination):-
"STAR 1"
Pause 3
A"H": B"M": C"S"
W = A + B/60 + C/3600
E"D": F"M": G"S"
X = E + F/60 + G/3600
D"SIGN +/-1"
D = -1 → X = XD ∆
"STAR 2"
Pause 3
H"H": I"M": J"S"
Y = H + I/60 + J/3600
L"D": M"M": N"S"
Z = L + M/60 + N/3600
K"SIGN (+/-1)"
K = -1 → Z = ZK ∆
U = 15(W - Y)
S = cos˹ (sin X x sin Z + cos X x cos Z x cos U) ▲
S > 0.1 → Goto 1 ∆
"RECALC"
Pause 3
T = √((cos X x U)² + (X - Z)²) ▲
Lbl 1
Before running this program it is best to set the mode to degrees and to clear the memories. The Right Ascension coordinates of the two objects are entered in the hours, minutes, seconds format and for the Declination in degrees, minutes, seconds. The angular separation of the two objects, S, is given in decimal degrees.
Further execution of the program is possible for small angles (less than 0.1 of a degree). This is because there may be a limitation in the accuracy of the calculator to return an exact result due to its precision. T gives an alternative calculation of the angular separation which may be more accurate.
All text and images © Duncan Hale-Sutton 2025
No comments:
Post a Comment