From 0c8970484e47ba8af886dc61ab6e4d308e9264cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=AF=E6=81=92?= <15487965+jingheng24073116@user.noreply.gitee.com> Date: Wed, 5 Mar 2025 08:50:23 +0000 Subject: [PATCH] update AstroLib/Src/AsCoordinate_2023.cpp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 景恒 <15487965+jingheng24073116@user.noreply.gitee.com> --- AstroLib/Src/AsCoordinate_2023.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/AstroLib/Src/AsCoordinate_2023.cpp b/AstroLib/Src/AsCoordinate_2023.cpp index 6baae65..0cc167d 100644 --- a/AstroLib/Src/AsCoordinate_2023.cpp +++ b/AstroLib/Src/AsCoordinate_2023.cpp @@ -1,4 +1,4 @@ -//////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////// // // // Copyright (c) 2003-2006 // // Wang Hua // @@ -17,4 +17,23 @@ using namespace std; - +//******************************************************************** +///柱坐标系到直角坐标系的位置速度转换 +/// @Author jingheng +/// @Date 2025/2/27 +/// @Input : +/// @Param ppolar 柱坐标系航天器位置 +/// @Param vpolar 柱坐标系航天器速度 +/// @Output : +/// @Param pcart 直角坐标系航天器位置 +/// @Param vcart 直角坐标系航天器速度 +//******************************************************************** +void AsPolarToCart(const CPolar3 & ppolar, const CPolar3 & vpolar, CCoord& pcart, CCoord& vcart) +{ + pcart[0] = ppolar.m_Radius*cos(ppolar.m_Theta); + pcart[1] = ppolar.m_Radius*sin(ppolar.m_Theta); + pcart[2] = ppolar.m_Z; + vcart[0] = vpolar.m_Radius*cos(ppolar.m_Theta) - ppolar.m_Radius*vpolar.m_Theta*sin(ppolar.m_Theta); + vcart[1] = vpolar.m_Radius*sin(ppolar.m_Theta) + ppolar.m_Radius*vpolar.m_Theta*cos(ppolar.m_Theta); + vcart[2] = vpolar.m_Z; +} -- Gitee