Starting with the following solution for SHO: $$x(t) = A\sin(\omega t+\varphi)\Rightarrow x_{0}=A\sin(\varphi)$$ $$\dot{x}(t) = v(t) = \omega A\cos(\omega t+\varphi) \Rightarrow v_{0}=\omega A\cos(\varphi)$$ I get the following initial phase: $$\Rightarrow \tan(\varphi) = \frac{x_{0} \omega}{v_{0}}$$
But starting with: $$x(t) = A\cos(\omega t+\varphi)\Rightarrow x_{0}=A\cos(\varphi)$$ which is a also a valid solution for the differential equation of the SMO, $$\dot{x}(t) = v(t) = -\omega A\sin(\omega t+\varphi) \Rightarrow v_{0}=-\omega A\sin(\varphi)$$ I get this initial phase: $$\Rightarrow \tan(\varphi) = -\frac{v_{0}}{x_{0} \omega}$$
Which one should be used? Are both correct?