Calculate the altitude of a triangle