source: trunk/MagicSoft/slalib/cs2c.c@ 6498

Last change on this file since 6498 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 921 bytes
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaCs2c ( float a, float b, float v[3] )
4/*
5** - - - - - - - -
6** s l a C s 2 c
7** - - - - - - - -
8**
9** Spherical coordinates to direction cosines.
10**
11** (single precision)
12**
13** Given:
14** a,b float spherical coordinates in radians
15** (RA,Dec), (long,lat) etc
16**
17** Returned:
18** v float[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 float cosb;
32
33 cosb = (float) cos ( b );
34 v[0] = (float) cos ( a ) * cosb;
35 v[1] = (float) sin ( a ) * cosb;
36 v[2] = (float) sin ( b );
37}
Note: See TracBrowser for help on using the repository browser.