# The (equation of the) Line perpendicular to line L that passes
Altitude:=proc(P,L):
expand(coeff(L,x,1)*(y-P[2]) - coeff(L,y,1)*(x-P[1])):
end:
# through Point P
# It uses the fact that the product of the slopes of perpendicular lines is -1