FACT++
1.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
void palRefv
(
double
vu
[3],
double
refa
,
double
refb
,
double
vr
[3]
)
Definition at line
129
of file
palRefv.c
.
References
DMAX
.
Referenced by
t_ref()
.
129
{
130
131
double
x,y,z1,z,zsq,rsq,r,wb,wt,d,cd,f;
132
133
/* Initial estimate = unrefracted vector */
134
x = vu[0];
135
y = vu[1];
136
z1 = vu[2];
137
138
/* Keep correction approximately constant below about 3 deg elevation */
139
z =
DMAX
(z1,0.05);
140
141
/* One Newton-Raphson iteration */
142
zsq = z*z;
143
rsq = x*x+y*y;
144
r = sqrt(rsq);
145
wb = refb*rsq/zsq;
146
wt = (refa+wb)/(1.0+(refa+3.0*wb)*(zsq+rsq)/zsq);
147
d = wt*r/z;
148
cd = 1.0-d*d/2.0;
149
f = cd*(1.0-wt);
150
151
/* Post-refraction x,y,z */
152
vr[0] = x*f;
153
vr[1] = y*f;
154
vr[2] = cd*(z+d*r)+(z1-z);
155
}
DMAX
#define DMAX(A, B)
Definition:
palmac.h:126
Here is the caller graph for this function:
pal
palRefv.c
Generated on Sun Sep 18 2016 20:50:39 for FACT++ by
1.8.11