FunctionAngular 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 );
Pascal/Delphi#include <VFmath.h>
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;
CUDA function C/C++#include <cudaVFmath.h>
int cudaVF_Kepler( fVector d_Y, fVector d_X, ui size, float T, float e );
int cusdVF_Kepler( fVector d_Y, fVector d_X, ui size, float *d_T, float *d_e );
int cudaVFx_Kepler( fVector d_Y, fVector d_X, ui size, float T, float e, float A, float B );
int cusdVFx_Kepler( fVector d_Y, fVector d_X, ui size, float *d_T, float *d_e, float *d_A, float *d_B );
int VFcu_Kepler( fVector h_Y, fVector h_X, ui size, float T, float e );
int VFxcu_Kepler( fVector h_Y, fVector h_X, ui size, float T, float e, float A, float B );
CUDA function Pascal/Delphiuses VFmath;
function cudaVF_Kepler( d_Y, d_X:fVector; size:UIntSize; T, e:Single ): IntBool;
function cusdVF_Kepler( d_Y, d_X:fVector; size:UIntSize; d_T, d_e:PSingle ): IntBool;
function cudaVFx_Kepler( d_Y, d_X:fVector; size:UIntSize; T, e, A, B:Single ): IntBool;
function cusdVFx_Kepler( d_Y, d_X:fVector; size:UIntSize; d_T, d_e, d_A, d_B:PSingle ): IntBool;
function VFcu_Kepler( h_Y, h_X:fVector; size:UIntSize; T, e:Single ): IntBool;
function VFxcu_Kepler( h_Y, h_X:fVector; size:UIntSize; T, e, A, B:Single ): IntBool;
Descriptionsimple 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 handlinge negative or e greater than 1.0 leads to an "Invalid parameter(s)" error. T = 0 leads to all Yi = 0.
Return valueFALSE (0), if no error occurred, otherwise TRUE (non-zero)

VectorLib Table of Contents  OptiVec home