⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nufromtp.m

📁 衛星軌道運算可算出課譜樂六元素的一個好程式
💻 M
字号:
% Richard Rieber
% September 27, 2006
% rrieber@gmail.com
%
% Revision 9/25/07 - Fixed a grusome error in the default tolerance.
%                    Changed from 10^8 radians to 10^-8 radians.  Whoops.
%
% function nu = nuFromM(Tp,ecc,n)
% 
% Purpose:  This function calculates the true anomaly (nu) of a position in an orbit given
%           the time since periapse passage in seconds, the eccentricity (ecc) of the orbit,
%           the mean motion (n) in radians/sec.
%           This uses another function, calcEA.
%           
% Input: o Tp  - Time since periapse passage (seconds)
%        o ecc - Eccentricity of orbit
%        o n   - Mean motion of orbiting body (radians/sec)
%        o tol - A tolerance for calculating the eccentric anomaly (see help calcEA.m)
%                Default is 10^-8 radians [OPTIONAL]
% 
% Output: o nu - True anomaly of position in radians

function nu = nuFromM(Tp,ecc,n,tol)

if nargin < 3 || nargin > 4
    error('Incorrect number of inputs, see help nuFromM.m')
elseif nargin == 3
    tol = 10-^8;
end

% Calculating the mean anomaly from the mean motion and time [see pg 53-54 of
% David A. Vallado's Fundamentals of Astrodynamics and Applications]
M = n*Tp;

E = calcEA(M,ecc,tol);  %Determining eccentric anomaly from mean anomaly

% Since tan(x) = sin(x)/cos(x), we can use atan2 to ensure that the angle for nu
% is in the correct quadrant since we know both sin(nu) and cos(nu).  [see help atan2]
nu = atan2((sin(E)*(1-ecc^2)^.5),(cos(E)-ecc));

⌨️ 快捷键说明

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