Transformation rules

Transforming HJD to phases: the transformation of heliocentric julian date (t) to phase is done by solving the differential equation:

\begin{displaymath}
d\Phi  (t) = \mathrm{mod} \left( \frac{dt}{P(t)} \right),
\end{displaymath}

where $P(t)$ is the period, which might or might not be a function of $t$. If $\dot P = dP/dt$ is 0, then integrating that equation yields:

\begin{displaymath}
\Phi  (t) = \mathrm{mod} \left( \frac{t-t_0}{P} \right).
\end{displaymath}

If, on the other hand, $\dot P \neq 0$, we obtain:

\begin{displaymath}
\Phi  (t) = \mathrm{mod} \left( \frac {1}{\dot P} \log \left[ P_0 + \dot P (t - t_0) \right] \right).
\end{displaymath}

In C, the division moduo is obtained by function fmod, which returns the value on the interval $(-1, 1)$, so to obtain desired phases set in plotting windows, simple interval mapping with optional aliasing is applied.