Answer:
A(x1, y1), B(x2, y2), C(x3, y3), D(x4, y4) form line segments AB and CD
For AB to be perpendicular to CD, triangle ABC should be a right angle or AC^2 = AB^2 + BC^2
(x3-x1)+(y3-y1) = (x2-x1)+(y2-y1) + (x3-x2)+(y3-y2)
If this is equal we can say AB is perpendicular to CD
Hope this helps!