Here is an image to illustrate my issue:
I need to calculate the vector $\vec{AD}$, knowing only the points A, B and C.
My initial idea was to calculate the angle $\alpha$ between $\vec{AB}$ and $\vec{AC}$, then calculate the last angle of the the triangle, by calculating $180 - 90 - \alpha$ and then use the arcsine of the resulting angle to get $\vec{AD}$. However I am not sure whether this is the most efficient approach, nor whether the method is error-safe.
Can anyone help me with this issue?

Note that $\vec{AD}$ is the orthogonal projection of $\vec {AC}$ on $\vec {AB}$ that is
$$\vec {AD}=\frac{\vec {AC}\cdot \vec {AB}}{\vec {AB}\cdot \vec {AB}}\vec {AB}$$