tp2ma.m

来自「航天工程工具箱」· M 代码 · 共 35 行

M
35
字号
function oe=tp2ma(oe,epoch,mu)
%TP2MA  Time of periapsis passage to mean anomaly at epoch.
%   OE_M = TP2MA(OE_T,EPOCH[,MU]) converts the osculating orbital elements
%   OE_T (Nx6) into the osculating orbital elements OE_M (Nx6), where:
%
%      OE_T = [a e i W w tp]
%      OE_M = [a e i W w M]
%
%   where
%
%      tp [s]   : timepoint of periapsis passage
%      M  [deg] : mean anomaly at EPOCH [YMDhms]
%
%   I.e. tp -> M at EPOCH.
%   M = M rem 360.
%
%   If MU = G*M is omitted, the central mass M is assumed to be the mass of
%   Earth.
%
%   See also MA2TP, ORB2CART, DATENUM, STDEPOCH.

% Copyright (c) 2003-04-17, B. Rasmus Anthin.
% Revision 2003-06-09.

r2d=180/pi;
d2r=pi/180;
if nargin<3, mu=constant('G')*constant('Me');end

te=datenum(epoch(:,1),epoch(:,2),epoch(:,3),epoch(:,4),epoch(:,5),epoch(:,6))*24*3600;
a=oe(:,1);
tp=oe(:,6);
n=sqrt(mu./a.^3);
M=n.*(te-tp);
oe(:,6)=unwrap(rem(M,2*pi))*r2d;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?