Slope is the ratio of coordinate change in y to coordinate change in x.
Let the slope of each segment AB and CD be m and n respectively.
Thus, m=(y1-y2/(x1-x2), and n=(y3-y4)/(x3-x4)
Here, we use the fact that, if 2 straight lines of different slopes, m and n, intersect each other perpendicularly, the product of 2 slopes is always equal to negative one(1): m·n=-1 (m,n≠0).
So, {(y1-y2)/(x1-x2)}·{(y3-y4)/(x3-x4)}=-1 That is: (y1-y2)·(y3-y4)=(-1)·(x1-x2)·(x3-x4)
The answer is: (y1-y2)·(y3-y4)=(-1)·(x1-x2)·(x3-x4)*
* This answer is just one example of equations. There must be lots of different forms.