From 7c9135a652598eab0735b4f59fca5bbaf70434c9 Mon Sep 17 00:00:00 2001 From: VALLONGOL Date: Fri, 24 Oct 2025 15:46:22 +0200 Subject: [PATCH] sistemato il verso dei target inviati dal server. --- target_simulator/gui/ppi_display.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/target_simulator/gui/ppi_display.py b/target_simulator/gui/ppi_display.py index a94032d..f0bc515 100644 --- a/target_simulator/gui/ppi_display.py +++ b/target_simulator/gui/ppi_display.py @@ -172,9 +172,13 @@ class PPIDisplay(ttk.Frame): # 2. Calculate vector displacement in Cartesian from heading # Heading is defined as degrees clockwise from North (0 = North), # so the unit vector in Cartesian (East, North) is (sin(h), cos(h)). - hdg_rad = math.radians(target.current_heading_deg) - dx_nm = vector_len_nm * math.sin(hdg_rad) - dy_nm = vector_len_nm * math.cos(hdg_rad) + # Invert the sign of the heading angle for plotting so the + # drawn heading arrow follows the same angular convention used + # for positions (theta_plot = -azimuth). Using -heading here + # ensures left/right orientation matches the displayed azimuth. + hdg_rad_plot = math.radians(-target.current_heading_deg) + dx_nm = vector_len_nm * math.sin(hdg_rad_plot) + dy_nm = vector_len_nm * math.cos(hdg_rad_plot) # 3. Find end point in Cartesian x_end_nm = x_start_nm + dx_nm