File: annuab.c

package info (click to toggle)
astronomical-almanac 5.6-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 1,104 kB
  • ctags: 408
  • sloc: ansic: 14,727; makefile: 158; xml: 109; sh: 1
file content (45 lines) | stat: -rw-r--r-- 780 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/* Annual aberration - AA pages B17, B37, C24
 */

#include "kep.h"
extern double Clightaud;

int annuab( p )
double p[]; /* unit vector pointing from earth to object */
{
double A, B, C;
double betai, pV;
double x[3], V[3];
int i;

/* Calculate the velocity of the earth (see vearth.c).
 */
velearth( TDT );
betai = 0.0;
pV = 0.0;
for( i=0; i<3; i++ )
	{
	A = vearth[i]/Clightaud;
	V[i] = A;
	betai += A*A;
	pV += p[i] * A;
	}
/* Make the adjustment for aberration.
 */
betai = sqrt( 1.0 - betai );
C = 1.0 + pV;
A = betai/C;
B = (1.0  +  pV/(1.0 + betai))/C;

for( i=0; i<3; i++ )
	{
	C = A * p[i]  +  B * V[i];
	x[i] = C;
	dp[i] = C - p[i];
	}

showcor( "annual aberration", p, dp );
for( i=0; i<3; i++ )
	p[i] = x[i];
return(0);
}