deflec.c 610 Bytes
Newer Older
Jeroen Vreeken's avatar
Jeroen Vreeken committed
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
/* Correct for light deflection due to solar gravitation.
 * AA page B37
 *
 * SE, pq, etc. were computed earlier by angles.c.
 */

#include "kep.h"

int relativity( p, q, e )
/* unit vector from earth to object:
 */
double p[];
/* heliocentric ecliptic rectangular coordinates
 * of earth and object:
 */
double q[], e[];
{
double C;
int i;

C = 1.974e-8/(SE*(1.0+qe));
for( i=0; i<3; i++ )
	{
	dp[i] = C*(pq*e[i]/SE - ep*q[i]/SO);
	p[i] += dp[i];
	}
if( prtflg )
	printf( "elongation from sun %.2f degrees, ", acos( -ep )/DTR );
showcor( "light defl.", p, dp );
return(0);
}