I have a particle with trajectory $P(t)$ describing a straight line. I am working with spherical coordinates (physicist's convention): $$x = r \sin \theta \cos \varphi, \quad y = r \sin \theta \sin \varphi, \quad z = r \cos \theta $$ Writing down $P(t) = ( P_r(t), P_\theta(t), P_\varphi(t) )$ in this coordinate system, at a given point (say $t=0$), I know the partial derivatives: $$ \left . \frac { \partial P_\theta(t) } { \partial t } \right |_{t = 0}$$
$$ \left . \frac{ \partial P_\varphi(t) } { \partial t } \right |_{t=0} $$
Given this information, I am interested in computing the $\theta$ and $\varphi$ components of the trajectory at infinity (say $\theta_\infty$, $\varphi_\infty$), which amounts to describing the $\theta$ and $\varphi$ coordinates of the straight line trajectory in a new spherical coordinate system centered at $P(0)$.
For the simpler situation of polar coordinates $(r,\varphi)$, I proceeded by computing the polar coordinates of a parametrised straight line, expressed in Cartesian coordinates as:
$$ P(t) = r_0 ( \cos \varphi_0, \sin \varphi_0 ) + t ( \cos \theta_{\infty}, \sin \theta_{\infty} )$$
Computing derivatives, after some algebraic manipulations I obtained the simple expression
$$ r_0 \left . \left ( \frac{ \partial P_\varphi } { \partial P_r } \right ) \right |_{t=0} = \tan \left ( \varphi_\infty - \varphi_0 \right ) $$
which allows the computation of $\varphi_\infty$ from $r_0$, $\varphi_0$ and the position derivatives at $t=0$.
I was hoping to find similar formulas for the case of spherical coordinates, but so far I have not managed as the algebra turned out too complex when using this same approach.
I realise that the above essentially boils down to computing the Jacobian of the transformation which moves the origin of the spherical coordinate system to $P(0)$: the components of the particle velocity are tangent vectors in the original coordinate system, and I want to obtain the tangent vector in the new coordinate system centered at $P(0)$. Yet I still find myself a bit swamped by the algebra, and am hoping for a simple formula that looks similar to the one I provided above for the case of polar coordinates.