How do you rotate a vector by $90^{\circ}$? Consider a vector $\vec{OA}$. How will I rotate this vector by $90^{\circ}$ and represent in algebraically?

Calling the vector $\overrightarrow v$, with components $v_x,v_y$ the angle between the vector and the $x$ axis is: $\alpha=\arctan\frac{v_y}{v_x}$. So if you add $\frac{\pi}{2}$ to $\alpha$, you get:
$$v_x=\overrightarrow v\cos(\alpha+\frac{\pi}{2})$$
$$v_y=\overrightarrow v\sin(\alpha+\frac{\pi}{2})$$
If you wanto to subtract $90°$, you need to put $\alpha-\frac{\pi}{2}$
