implemented methods for calculating perpendicular foot