sistemato il verso dei target inviati dal server.

This commit is contained in:
VALLONGOL 2025-10-24 15:46:22 +02:00
parent 243dc5732b
commit 7c9135a652

View File

@ -172,9 +172,13 @@ class PPIDisplay(ttk.Frame):
# 2. Calculate vector displacement in Cartesian from heading # 2. Calculate vector displacement in Cartesian from heading
# Heading is defined as degrees clockwise from North (0 = North), # Heading is defined as degrees clockwise from North (0 = North),
# so the unit vector in Cartesian (East, North) is (sin(h), cos(h)). # so the unit vector in Cartesian (East, North) is (sin(h), cos(h)).
hdg_rad = math.radians(target.current_heading_deg) # Invert the sign of the heading angle for plotting so the
dx_nm = vector_len_nm * math.sin(hdg_rad) # drawn heading arrow follows the same angular convention used
dy_nm = vector_len_nm * math.cos(hdg_rad) # 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 # 3. Find end point in Cartesian
x_end_nm = x_start_nm + dx_nm x_end_nm = x_start_nm + dx_nm