Projecting point on triangle base to other triangle edges What is the simplest way to project a point on triangle base (green edge) to other edges (blue edges) using right angle. If we only know the coordinates of the triangle vertexes $a$, $b$, $c$ and a point to project $x$.
We don't know in witch side of $h$ the point $x$ is. I would prefer a solution which do not require finding point $h$.

 A: The orthogonal projection of a vector $\bf x$ onto the line spanned by the vector $\bf y$ is
$$\text{proj}_{\bf y} {\bf x} = \frac{{\bf x} \cdot {\bf y}}{{\bf y} \cdot {\bf y}} {\bf y}.$$ To project a point ${\bf X}$ onto the side $\overline{\bf AC}$ of a triangle with vertices ${\bf A}, {\bf B}, {\bf C}$, we translate the triangle sending say, $\bf A$ is at the origin, apply the orthogonal transformation, and translate back.
The translation is just ${\bf x} \mapsto {\bf x} - {\bf A}$, and so maps the line segment $\overline{\bf AC}$ to the side with endpoints $\bf 0$ and ${\bf C} - {\bf A}$, and the point $\bf X$ to ${\bf X} - {\bf A}$, and the projection of ${\bf X} - {\bf A}$ onto ${\bf C} - {\bf A}$ is
$$\text{proj}_{{\bf C} - {\bf A}} ({\bf X} - {\bf A}) = \frac{({\bf X} - {\bf A}) \cdot ({\bf C} - {\bf A})}{({\bf C} - {\bf A}) \cdot ({\bf C} - {\bf A})} ({\bf C} - {\bf A}).$$ Finally, translating the points back to the original triangle gives that the orthogonal projection $\bf X$ onto $\overline{\bf AC}$ is
$$\text{proj}_{{\bf C} - {\bf A}} ({\bf X} - {\bf A}) + {\bf A} = \frac{({\bf X} - {\bf A}) \cdot ({\bf C} - {\bf A})}{({\bf C} - {\bf A}) \cdot ({\bf C} - {\bf A})} ({\bf C} - {\bf A}) + {\bf A}.$$
