From 18fc8fcb0e57ab5ae9d13a4373cbbc5cceffcf07 Mon Sep 17 00:00:00 2001 From: dmy Date: Wed, 4 Mar 2026 11:13:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E4=BF=9D=E6=8A=A4?= =?UTF-8?q?=E8=A7=92=E8=AE=A1=E7=AE=97=E5=85=AC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/main.py b/main.py index 4b8785c..7b62296 100644 --- a/main.py +++ b/main.py @@ -145,18 +145,12 @@ def run_egm(para: Parameter, animation=None) -> dict: rg_y = gc_y[phase_conductor_foo + 2] else: rg_type = "g" - # TODO 保护角公式可能有问题,后面改 + # 使用实际高度(考虑弧垂)计算保护角 shield_angle_at_avg_height = ( - math.atan( - (rc_x - rs_x) - / ( - (h_arm[0] - string_g_len - h_arm[phase_conductor_foo + 1]) - + string_c_len - ) - ) + math.atan2(rc_x - rs_x, rs_y - rc_y) * 180 / math.pi - ) # 挂点处保护角 + ) logger.info(f"地线保护角{shield_angle_at_avg_height:.2f}°") logger.debug(f"最低相防护标识{rg_type}。(g表示地面,c表示下导线)") rated_voltage = para.rated_voltage