]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/marker_beacon.cxx
throw out "zoomed" tapes. These drew 60% of the scale with bullets rather
[flightgear.git] / src / Instrumentation / marker_beacon.cxx
index 012f1c9847d6a1c8044c133dbca0a15f4dab6867..35179c992c653e6bdb63279e93862f5a0647877b 100644 (file)
@@ -206,13 +206,7 @@ FGMarkerBeacon::update(double dt)
 static bool check_beacon_range( const SGGeod& pos,
                                 FGNavRecord *b )
 {
-    SGVec3d aircraft = SGVec3d::fromGeod(pos);
-    SGVec3d station = b->get_cart();
-    // cout << "    aircraft = " << aircraft << " station = " << station
-    //      << endl;
-
-    SGVec3d tmp = station - aircraft;
-    double d = dot(tmp, tmp);
+    double d = distSqr(b->get_cart(), SGVec3d::fromGeod(pos));
     // cout << "  distance = " << d << " ("
     //      << FG_ILS_DEFAULT_RANGE * SG_NM_TO_METER
     //         * FG_ILS_DEFAULT_RANGE * SG_NM_TO_METER