72 const double MAX_RAD = 320e3;
73 const double MIN_DIST = 150e3;
76 double scale = 1 - dist/MAX_RAD;
80 if (fabs(loc.
z) > 20e3)
94 else if (dist > 1.25 * MAX_RAD) {
95 double scale = 1 - dist/MAX_RAD;
99 if (fabs(loc.
z) > 20e3)
116 if (fabs(loc.
z) > 20e3)
131 double closest_dist = 1e6;
141 if (dist < closest_dist) {
148 if (closest_unit && closest_dist < MIN_DIST) {
152 loc += delta * 1.1 * (MIN_DIST - closest_dist);
154 if (fabs(loc.
z) > 20e3)