Showing posts with label right ascension. Show all posts
Showing posts with label right ascension. Show all posts

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. 


Monday, June 12, 2017

HP Prime and Casio fx-9860GII/Prizm: Angular Distance Between Stars

HP Prime and Casio fx-9860GII/Prizm:  Angular Distance Between Stars

Given the right ascension (α) and declination (δ) of two stars of the same epoch (J2000.0 is the most current), the distance between the stars are:

d = acos( sin δ1 * sin δ2 + cos δ1 * cos δ2 * cos (α1 – α2) )

The distance is usually given in decimal degrees.

Enter α in terms of hours, minutes, seconds (standard notation) and δ in terms of degrees, minutes, seconds (standard notation).

HP Prime Program:   ANGSTAR

EXPORT ANGSTAR(α1,δ1,α2,δ2)
BEGIN
// 2017-06-08 EWS
// Angular Angle

// Degrees
HAngle:=1;

LOCAL d;

α1:=15*α1;
α2:=15*α2;

d:=ACOS(SIN(δ1)*SIN(δ2)+
COS(δ1)*COS(δ2)*COS(α1-α2));

RETURN →HMS(d);
END;

Casio fx-9860GII/Prizm Program:  ANGSTAR

Deg
“RA 1: “?→A
“DEC1: “?→B
15A→A
“RA 2: “?→C
“DEC2: “?→D
15C→C
cos¯¹ (sin B * sin D + cos B * cos D * cos (A-C))→E
E>DMS

Example

Distance between Regulus (A) in Leo and Sadalmelik in Aquarius:

(data via Wikipedia)
Regulus:  α = 10h8m23.11s,  δ = +11°58’01.95”

Sadamelik:  α = 22h5m47.03593s, δ = -0°19’11.4568”

Distance:  168°20’05.1793”

Source:
Meeus, Jean.  Astronomical Algorithms  William-Bell, Inc.  Richmond, VA 1991.  ISBN 0-943396-35-2


Please stay safe, happy, and sane. Happy computing,

Eddie

I hope to have the new Casio Prizm FX-CG50 soon for review as I ordered one last Friday. 

This blog is property of Edward Shore, 2017.

Tuesday, March 3, 2015

HP Prime: Solar Position (Right Ascension, Declination, Altitude, Azimuth)

HP Prime: Solar Position (Right Ascension, Declination, Altitude, Azimuth)

Input:
* Month
* Date
* Year
* Local Time (your local standard time – do not adjust for daylight savings time)
* Longitude
* Latitude


Local Time:  Use a 24 Hour clock. When entering time, you can enter a decimal or hours°minutes’seconds’’.

Longitude:  This is your location, going east from the Greenwich Prime Meridian.  East is positive, West is negative. Range: -180° to 180°

Latitude: This is your location, going north from the Equator.  North is positive, South is negative.  Range:  -90° to 90°

Entering HMS:

HP Prime:  Use Shift+9 and select the appropriate symbol (°, ‘, or ‘’)

Output:
r:  Distance from the Earth to the Sun in astronomical units (AU)
α:  Right ascension in decimal hours
δ:  Declination in decimal degrees
eot:  Equation of Time in minutes
alt:  Altitude/Elevation
azi:  Azimuth, from due North going clockwise

Please keep in mind that these are approximate answers.

Also, a 2-column matrix is returned to the home screen for reference.  The first column is the input column, the second is the output column.

[[ month,  distance ]
[ day,  right ascension ]
[ year, declination ]
[ local time, declination ]
[ longitude, altitude ]
[ latitude, azimuth ]]

HP Prime:  solar

EXPORT solar()
BEGIN
// aa.usno.navy.mil
// Updated 2015-03-01 EWS

// month, day, year, local standard
// time, longitude, latitude
LOCAL m,D,Y,lstd,long,lat;

INPUT({m,D,Y,lstd,long,lat},
"Data: Use Shift+9 for H°M′S″",
{"Month:","Date :","Year :",
"Local Time (24):", "Long (+E):",
"Lat (+N)"});

// Initialization
LOCAL d,g,q,L,r,ec,gmt;
LOCAL eot,alt,lha,azi,zen,loc;
LOCAL α,δ,g1,g2;
LOCAL w1,w2;
HAngle:=1;

// Greenwich Mean Time
gmt:=lstd-long/15;

// Julian Date
d:=367*Y-IP(7*(Y+IP((m+9)/12))/4)
+IP((275*m)/9)+D+1721013.5+gmt/24
-0.5*SIGN(100*Y+m-190002.5)+0.5;
d:=d-2451545;

// Intermediate Calculations
g:=(357.529+.98560028*d)  MOD 360;
q:=(280.459+.98564736*d) MOD 360;
L:=(q+1.915*SIN(g)+.02*SIN(2*g)) MOD 360;
r:=1.00014-.01671*COS(g)-.00014*COS(2*g);
ec:=23.439291-.00000036*d;

α:=ARG(COS(L)+SIN(L)*COS(ec)*i) MOD 360;

// Convert to hours
α:=α/15;

// Declination
δ:=ASIN(SIN(ec)*SIN(L));

// Equation of Time
eot:=q/15-α;
eot:=eot*60;

// Greenwich Mean Time (in hours)
g1:=-0.000319*SIN(−125.04-0.052954*d)
-2.4ᴇ−5*SIN(560.94+1.9713*d);
gmt:=(18.697374558+24.06570982441908*d
+g1*COS(ec)) MOD 24;

// Hour Angle (in degrees)
lha:=(gmt-α)*15+long;

// Altitude (approximate)
alt:=ASIN(SIN(lat)*SIN(δ)+
COS(lat)*COS(δ)*COS(lha));

// Azimuth
// Clockwise from South
azi:=ARG(SIN(lha)*i+COS(lha)*SIN(lat)
-TAN(δ)*COS(lat));
// Convert to clockwise from North
azi:=azi+180;

PRINT();
PRINT("Sun "+m+"/"+D+"/"+Y+" ; "+lstd);
PRINT("Distance: "+r);
PRINT("α (hours): "+α);
PRINT("δ (degrees): "+δ);
PRINT("eot (minutes): "+eot);
PRINT("Approximate");
PRINT("alt (elevation): "+alt);
PRINT("azi (North-clockwise): "+azi);

PRINT("DEGREES MODE SET");
RETURN [[m,r],[D,α],[Y,δ],[lstd,eot],
[long,alt],[lat,azi]];
END;


Example:

Input:
June 1, 2015; 12:00 PM , Longitude: -118°13’59”, Latitude: 34°3’

Output:
r = 1.01406353128 AU
α = 4.6292012064 hr
δ = 22.0919016903°
eot = 2.157339456 min
alt = 78.032250726°
azi = 182.442424012°


Resources:

The United States Naval Observatory (USNO)  Washington, D.C.:
“Approximate Solar Coordinates” (URL:  http://aa.usno.navy.mil/faq/docs/SunApprox.php )
“Approximate Sidereal Time” (URL: http://aa.usno.navy.mil/faq/docs/GAST.php )
“Computing Altitude and Azimuth from Greenwich Apparent Sidereal Time” (URL: http://aa.usno.navy.mil/faq/docs/Alt_Az.php )
“Converting Between Julian Dates and Gregorian Calendar Dates” (URL: http://aa.usno.navy.mil/faq/docs/JD_Formula.php )
Retrieved February 23, 2015 to March 1, 2015

This blog is property of Edward Shore - 2015


Wednesday, November 26, 2014

Astronomy: Distance and Midpoint Between Two Celestial Objects

Astronomy: Distance and Midpoint Between Two Celestial Objects


Stars and celestial objects have the equatorial coordinates ( α, δ, R ) where:

α = right ascension in hours, minutes, and seconds
δ = declination in degrees, minutes, and seconds
R = distance to the celestial about (in light years, astronomical units, etc)

Convert α and δ to decimal degrees:

α = (hours + minutes/60 + seconds/3600) * 15
δ = sign(δ) * ( |degrees| + |minutes/60| + |seconds/3600| )

However, calculating distance between two points in space requires that we have cartesian coordinates (x, y, z). The conversion formulas to go from equatorial to cartesian coordinates are:

x = R * cos δ * sin α
y = R * cos δ * cos α
z = R * sin δ

For completeness, here are the conversion formulas to from cartesian to equatorial coordinates:

R = √(x^2 + y^2 + z^2)
δ = asin(z/R)
α = atan(y/x) (pay attention to the quadrant!). Alternatively: α = arg(x + i*y)

The distance formula between two points in space is:

D = √( (x2 - x1)^2 + (y2 - y1)^2 + (z2 - z1)^2 )

Source: http://en.m.wikipedia.org/wiki/Equatorial_coordinate_system

Example

Find the distance between Sagittarius A* (center of the Milky Way Galaxy) and the Andromeda Galaxy (M31).

Equatorial Coordinates:

From Wolfram Alpha: ( http://m.wolframalpha.com )

Sagittarius A*:
R = 24,824 light years
α = 17h45m40s = 266.42°
δ = -29°0'28" = -29.008°

Andromeda Galaxy:
R = 2,571,000 light years
α = 42m40s = 10.68°
δ = 41°16'8" = 41.269°

Converting to the cartesian system:

Sagittarius A*:
x = -21,667.514038
y = -1,355.611275
z = -12,037.945401

Andromeda Galaxy:
x = 358,122.65578
y = 1,898,943.67736
z = 1,695,818.99789

Calculation:

D = √( (-21,667.514038 - 358,122.65578)^2 + (-1,355.611275 - 1,898,943.67736)^2
+ (-12,037.945401 - 1,695,818.99789)^2 ) ≈ 2,583,051.16059

The distance between Sagittarius A* and the Andromeda Galaxy is about 2.583 million light years.

Happy Thanksgiving, or Day of Thanks, wherever you are. Please be safe and use good judgement. We need all the positive we can get on Earth, and in the cosmos. Cheers!

Eddie

This blog is property of Edward Shore. 2014

RPN HP 12C: Fibonacci and Lucas Sequences

  RPN HP 12C: Fibonacci and Lucas Sequences Golden Ratio, Formulas, and Sequences Let φ be the Golden Ratio: φ = (1 + √5) ÷ 2...