# How would you convert keplerian orbital elments into cartesain vectors with quaternions?

Coverting the keplerian elements to cartesain vectors ( posistion and velocity) is relatievly simple by using rotation matrices show in the document here: https://downloads.rene-schwarz.com/download/M001-Keplerian_Orbit_Elements_to_Cartesian_State_Vectors.pdf

Though I was wondering would I be possible to convert the elements into vectors using quaternions instead of matrix rotation? If so how would you do it?

The conversion to Keplerian orbital elements to Cartesian orbital element is not typically done using rotation matrices. The reason for this is that it's an incomplete method: it does not work for hyperbolic orbits, and I don't think it works for near circular orbit (because the eccentricity is ill-defined, so the eccentric anomaly ($$E$$) will also be ill-defined). Instead, the method used by GMAT and Nyx (and surely others) consists in using the semi-parameter to calculate the radius and velocity vectors, cf. this explanation and the associated algorithm.