The problem
I'm trying to get a formula to calculate the state vectors $\vec{r}$ and $\vec{v} = \dot{\vec{r}}$ on an orbit, given a true anomaly $\nu$. I'm following the process described here : https://downloads.rene-schwarz.com/download/M001-Keplerian_Orbit_Elements_to_Cartesian_State_Vectors.pdf . The first calculation step involves calculating the intermediate simple state vectors $\vec{o}$ and $\dot{\vec{o}}$ laying in the xy plane (which are then rotated in space to get $\vec{r}$ and $\vec{v}$ respectively) :
$$ \vec{o} = r\left(\begin{array}{ c } \cos \nu\\ \sin \nu \\ 0 \end{array}\right), \ \ \dot{\vec{o}} = \frac{\sqrt{\mu a}}{r}\left(\begin{array}{ c } -\sin E\\ \sqrt{1-e^{2}}\cos E\\ 0 \end{array}\right) $$
with $r = \dfrac{p}{1+e\cos\nu}$.
This works well in the case of an elliptic orbit, but it is invalid for a hyperbolic one because of $e > 1$ and $a < 0$ resulting in $\sqrt{1-e^2}$ and $\sqrt{\mu a}$ being undefined.
My current solution
In the case of an hyperbolic orbit, I adapted the second answer from this post : Calculating velocity state vector with orbital elements in 2D to calculate $\dot{\vec{o}}$ with the flight path angle $\phi$, knowing the angular momentum $h = ||\vec{h}||$. We first calculate the radial unit vector $\hat{u_o}$ of the intermediate position vector, and $\hat{u_s}$ the unit vector perpendicular to $\hat{u_o}$ in the xy plane :
$$ \hat{u_o} = \frac{\vec{o}}{r} = \left(\begin{array}{ c } u_{o,\ x}\\ u_{o,\ y}\\ 0 \end{array}\right) , \ \ \hat{u_s} = \left(\begin{array}{ c } -u_{o,\ y}\\ u_{o,\ x}\\ 0 \end{array}\right) $$
We then calculate the sin and cos of the flight path angle : $$ \cos \phi = \frac{h}{rv}, \ \ \sin \phi = \frac{e \sin \nu}{1 + e \cos \nu} \cos \phi $$
with $v$ being the magnitude of the velocity, calculated from the vis-viva equation. And finally, we get the intermediate velocity vector :
$$ \dot{\vec{o}} = v(\sin(\phi)\hat{u_o} + \cos(\phi)\hat{u_s}) $$
A better solution ?
Is there a better, more straightforward way, to compute this intermediate velocity vector in the case of a hyperbolic orbit ? One that doesn't require knowing $h$. For example, is there a formula similar to the one given in the PDF that makes use of the hyperbolic eccentric anomaly $H$ ?
Thanks in advance.