source: trunk/MagicSoft/slalib/ecor.c@ 9488

Last change on this file since 9488 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaEcor ( float rm, float dm, int iy, int id, float fd,
4 float *rv, float *tl )
5/*
6** - - - - - - - -
7** s l a E c o r
8** - - - - - - - -
9**
10** Component of Earth orbit velocity and heliocentric
11** light time in a given direction.
12**
13** (single precision)
14**
15** Given:
16** rm,dm float mean RA,Dec of date (radians)
17** iy int year
18** id int day in year (1 = Jan 1st)
19** fd float fraction of day
20**
21** Returned:
22** *rv float component of Earth orbital velocity (km/sec)
23** *tl float component of heliocentric light time (sec)
24**
25** Notes:
26**
27** 1 The date and time is TDB (loosely ET) in a Julian calendar
28** which has been aligned to the ordinary Gregorian
29** calendar for the interval 1900 March 1 to 2100 February 28.
30** The year and day can be obtained by calling slaCalyd or
31** slaClyd.
32**
33** 2 Sign convention:
34**
35** The velocity component is +ve when the Earth is receding from
36** the given point on the sky. The light time component is +ve
37** when the Earth lies between the Sun and the given point on
38** the sky.
39**
40** 3 Accuracy:
41**
42** The velocity component is usually within 0.004 km/s of the
43** correct value and is never in error by more than 0.007 km/s.
44** The error in light time correction is about 0.03s at worst,
45** but is usually better than 0.01s. For applications requiring
46** higher accuracy, see the slaEvp routine.
47**
48** Called: slaEarth, slaCs2c, slaVdv
49**
50** Last revision: 24 November 1994
51**
52** Copyright P.T.Wallace. All rights reserved.
53*/
54
55#define AUKM 1.4959787066e8f /* AU to km (1985 Almanac) */
56#define AUSEC 499.0047837f /* AU to light sec */
57
58{
59 float pv[6], v[3];
60
61/* Sun:Earth position & velocity vector */
62 slaEarth ( iy, id, fd, pv );
63
64/* Star position vector */
65 slaCs2c ( rm, dm, v );
66
67/* Velocity component */
68 *rv = - AUKM * slaVdv ( &pv[3], v );
69
70/* Light time component */
71 *tl = AUSEC * slaVdv ( pv, v );
72}
Note: See TracBrowser for help on using the repository browser.