ma2tp.m

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

M
36
字号
function oe=ma2tp(oe,epoch,mu)
%MA2TP  Mean anomaly at epoch to time of periapsis passage.
%   OE_T = MA2TP(OE_M,EPOCH,MU]) converts the osculating orbital elements
%   OE_M (Nx6) into the osculating orbital elements OE_T (Nx6), where:
%
%      OE_M = [a e i W w M]
%      OE_T = [a e i W w tp]
%
%   where
%
%      M  [deg] : mean anomaly at EPOCH [YMDhms]
%      tp [s]   : timepoint of periapsis passage (from A.D.)
%
%   I.e. M at EPOCH -> tp.
%   tp = tp rem P.
%
%   If MU = G*M is omitted, the central mass M is assumed to be the mass of
%   Earth.
%
%   See also TP2MA, ORB2CART, DATENUM, DATEVEC, 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);
M=oe(:,6);
n=sqrt(mu./a.^3)*r2d;
P=360./n;
tM=M./n;
tp=te-tM;
oe(:,6)=rem(tp,P);

⌨️ 快捷键说明

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