source: trunk/MagicSoft/slalib/eqgal.c

Last change on this file was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 1.9 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaEqgal ( double dr, double dd, double *dl, double *db )
4/*
5** - - - - - - - - -
6** s l a E q g a l
7** - - - - - - - - -
8**
9** Transformation from J2000.0 equatorial coordinates to
10** IAU 1958 Galactic coordinates.
11**
12** (double precision)
13**
14** Given:
15** dr,dd double J2000.0 RA,Dec
16**
17** Returned:
18** *dl,*db double Galactic longitude and latitude l2,b2
19**
20** (all arguments are radians)
21**
22** Called:
23** slaDcs2c, slaDmxv, slaDcc2s, slaDranrm, slaDrange
24**
25** Note:
26** The equatorial coordinates are J2000.0. Use the routine
27** slaEg50 if conversion from B1950.0 'FK4' coordinates is
28** required.
29**
30** Reference:
31** Blaauw et al, Mon.Not.R.astron.Soc.,121,123 (1960)
32**
33** Last revision: 21 September 1998
34**
35** Copyright P.T.Wallace. All rights reserved.
36*/
37{
38 double v1[3], v2[3];
39
40/*
41** l2,b2 system of Galactic coordinates
42**
43** p = 192.25 RA of Galactic north pole (mean B1950.0)
44** q = 62.6 inclination of Galactic to mean B1950.0 equator
45** r = 33 longitude of ascending node
46**
47** p,q,r are degrees
48**
49** Equatorial to Galactic rotation matrix (J2000.0), obtained by
50** applying the standard FK4 to FK5 transformation, for zero proper
51** motion in FK5, to the columns of the B1950 equatorial to
52** Galactic rotation matrix:
53*/
54 static double rmat[3][3];
55
56 rmat[0][0] = -0.054875539726;
57 rmat[0][1] = -0.873437108010;
58 rmat[0][2] = -0.483834985808;
59 rmat[1][0] = 0.494109453312;
60 rmat[1][1] = -0.444829589425;
61 rmat[1][2] = 0.746982251810;
62 rmat[2][0] = -0.867666135858;
63 rmat[2][1] = -0.198076386122;
64 rmat[2][2] = 0.455983795705;
65
66/* Spherical to Cartesian */
67 slaDcs2c ( dr, dd, v1 );
68
69/* Equatorial to Galactic */
70 slaDmxv ( rmat, v1, v2 );
71
72/* Cartesian to spherical */
73 slaDcc2s ( v2, dl, db );
74
75/* Express in conventional ranges */
76 *dl = slaDranrm ( *dl );
77 *db = slaDrange ( *db );
78}
Note: See TracBrowser for help on using the repository browser.