+
+ //// calculate look left/right to target, without yaw correction
+ // double horiz_offset = bearing - heading;
+ //
+ // if (horiz_offset > 180.0) horiz_offset -= 360.0;
+ // if (horiz_offset < -180.0) horiz_offset += 360.0;
+
+ //// now correct look left/right for yaw
+ // horiz_offset += yaw;
+
+ // use the bearing for plan position indicator display
+
+ double horiz_offset = bearing;
+
+ SG_LOG( SG_INSTR, SG_DEBUG, "distance_nm " << distance_nm << " bearing "
+ << bearing << " horiz_offset " << horiz_offset);
+
+ // calculate values for radar display
+ double y_shift = distance_nm * cos( horiz_offset * SG_DEGREES_TO_RADIANS);
+ double x_shift = distance_nm * sin( horiz_offset * SG_DEGREES_TO_RADIANS);
+
+ SG_LOG( SG_INSTR, SG_DEBUG, "y_shift " << y_shift << " x_shift " << x_shift);
+
+ double rotation = 0;