X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fmarker_beacon.cxx;h=35179c992c653e6bdb63279e93862f5a0647877b;hb=010e03fab49219813f2957b0e494672d01d62ff4;hp=012f1c9847d6a1c8044c133dbca0a15f4dab6867;hpb=7647b1620b3b70367e7852eba5fc035dcfffd1ad;p=flightgear.git diff --git a/src/Instrumentation/marker_beacon.cxx b/src/Instrumentation/marker_beacon.cxx index 012f1c984..35179c992 100644 --- a/src/Instrumentation/marker_beacon.cxx +++ b/src/Instrumentation/marker_beacon.cxx @@ -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