|Function||Angular position of a planet according to Kepler's Second Law|
|Syntax C/C++||#include <VFmath.h>
int VF_Kepler( fVector Y, fVector X, ui size, float T, float e );
int VFx_Kepler( fVector Y, fVector X, ui size, float T, float e, float A, float B );
|C++ VecObj||#include <OptiVec.h>
int vector<T>::Kepler( const vector<T>& X, T t, T e );
int vector<T>::x_Kepler( const vector<T>& X, T t, T e, const T& A, const T& B );
function VF_Kepler( Y, X:fVector; size:UIntSize; T, e:Single ): IntBool;
function VFx_Kepler( Y, X:fVector; size:UIntSize; T, e, A, B:Single ): IntBool;
|Description||normal versions: Yi = Kepler( Xi/T, e );
expanded versions: Yi = Kepler( (A*Xi+B)/T, e );
The time-dependent angular position of a planet is calculated from its round-trip time T and its eccentricity e.
T must be non-zero; e may take on values 0 <= e <= 1. While there is no analytic solution to this problem, described by Johannes Kepler's Second Law, an efficient iterative algorithm is known and is used here. This algorithm is fast and stable up to the hyperbolic limit, e = 1.0.
Rather than treating the problem in terms of the reduced time m = t/T (like it is done in Astronomy textbooks), VF_Kepler expects the real times in X and divides them internally by T.
As there may hardly be any occasions when one might wish to scale the obtained angular position by a constant, no multiplication by C is included in the VFx_ version which, consequently, has only A and B as additional arguments (unlike most of the other "expanded versions" of VectorLib math functions).
This function may not be called while the FPU is set to reduced accuracy, or else it might hang in an infinite loop. See V_setFPAccuracy. As seome versions of Windows (from XP x64 on) automatically reduce the FPU to double precision, a call to the VE_ version should be preceded by a call to V_setFPAccuracy( 3 );
|Error handling||e negative or e greater than 1.0 leads to an "Invalid parameter(s)" error. T = 0 leads to all Yi = 0.|
|Return value||FALSE (0), if no error occurred, otherwise TRUE (non-zero)|