47 LoMediumDistortionMap::LoMediumDistortionMap(
Camera *parent) :
94 QString centkey =
"INS" +
toString(naifIkCode) +
"_POINT_OF_SYMMETRY";
95 p_sample0 = boreS - p_camera->Spice::getDouble(centkey, 0);
96 p_line0 = boreL + p_camera->Spice::getDouble(centkey, 1);
132 if(fabs(dx) > 45.79142767 || fabs(dy) > 35.09)
return false;
145 double origr2 = dists * dists + distl * distl;
146 double sp = sqrt(origr2);
148 p_undistortedFocalPlaneX = dx;
149 p_undistortedFocalPlaneY = dy;
155 double nS = sp / sRef;
156 double dS = p_odk[0] * nS + p_odk[1] * pow(nS, 3) + p_odk[2] * pow(nS, 5);
157 double prevdS = 2 * dS;
158 double pixtol = .000001;
163 while(fabs(dS - prevdS) > pixtol) {
165 if(numit > 14 || fabs(dS) > 1E9) {
175 dS = p_odk[0] * nS + p_odk[1] * pow(nS, 3) + p_odk[2] * pow(nS, 5);
180 double ratio = s / sp;
181 double undistortedSample = dists * ratio +
p_sample0;
182 double undistortedLine = distl * ratio +
p_line0;
211 p_undistortedFocalPlaneX = ux;
212 p_undistortedFocalPlaneY = uy;
215 if(fabs(ux) > 45.79142767 || fabs(uy) > 35.09)
return false;
216 if(fabs(ux) > 41.85 || fabs(uy) > 35.09)
return false;
233 double rp2 = (distus * distus + distul * distul);
236 p_focalPlaneX = p_undistortedFocalPlaneX;
237 p_focalPlaneY = p_undistortedFocalPlaneY;
242 rp2 = rp2 / sRef / sRef;
243 double drOverR = (p_odk[0] + rp2 * p_odk[1] + rp2 * rp2 * p_odk[2]) / sRef;
246 double ds = p_sample0 + (distus * (1. + drOverR));
247 double dl = p_line0 + (distul * (1. + drOverR));