/*******************************************************************************
*$ Component_name:
*	Kep_Precess
*$ Abstract:
*	Precesses orbital elements to a new epoch.
*$ Keywords:
*	KEPLER, ORBITAL_MOTION
*	C, PUBLIC
*$ Declarations:
*	void		Kep_Precess( orbit, time, peri, node, meanLon )
*	KEP_ORBIT	*orbit;		(typedef defined in "kepler.h")
*	double		time, *peri, *node, *meanLon;
*$ Inputs:
*	*orbit		current orbital elements.
*	time		absolute time (sec) of new epoch.
*$ Outputs:
*	*peri		new longitude of pericenter (radians).
*	*node		new longitude of ascending node (radians).
*	*meanLon	new mean longitude of orbiting body (radians).
*$ Returns:
*	none
*$ Detailed_description:
*	This routine takes an orbit defined using Kep_SetOrbit() and returns
*	its orbital elements precessed to a new epoch.
*$ External_references:
*	none
*$ Examples:
*	none
*$ Error_handling:
*	none
*$ Limitations:
*	Orbital rates used for this calculation will be slightly in error for
*	eccentric and/or inclined orbits (cf. Kep_Omega(), Kep_Apse(), and
*	Kep_Node()).
*$ Author_and_institution:
*	Mark R. Showalter
*	NASA/Ames Research Center
*$ Version_and_date:
*	1991 June 18
*$ Change_history:
*	none
*******************************************************************************/
#include "kepler.h"

void		Kep_Precess( orbit, time, peri, node, meanLon )
KEP_ORBIT	*orbit;
double		time, *peri, *node, *meanLon;
{
double		dT;

	dT = time - orbit->epoch;
	*peri =    orbit->peri    + dT * orbit->dPdT;
	*node =    orbit->node    + dT * orbit->dNdT;
	*meanLon = orbit->meanLon + dT * orbit->omega;

	return;
}

/******************************************************************************/
