source: trunk/MagicSoft/slalib/dcs2c.c@ 17165

Last change on this file since 17165 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 909 bytes
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaDcs2c ( double a, double b, double v[3] )
4/*
5** - - - - - - - - -
6** s l a D c s 2 c
7** - - - - - - - - -
8**
9** Spherical coordinates to direction cosines.
10**
11** (double precision)
12**
13** Given:
14** a,b double spherical coordinates in radians
15** (RA,Dec), (long,lat) etc
16**
17** Returned:
18** v double[3] x,y,z unit vector
19**
20** The spherical coordinates are longitude (+ve anticlockwise
21** looking from the +ve latitude pole) and latitude. The
22** Cartesian coordinates are right handed, with the x axis
23** at zero longitude and latitude, and the z axis at the
24** +ve latitude pole.
25**
26** Last revision: 31 October 1993
27**
28** Copyright P.T.Wallace. All rights reserved.
29*/
30{
31 double cosb;
32
33 cosb = cos ( b );
34 v[0] = cos ( a ) * cosb;
35 v[1] = sin ( a ) * cosb;
36 v[2] = sin ( b );
37}
Note: See TracBrowser for help on using the repository browser.