How to calculate the altitude of a triangle