The points (X1,Y1), (X2,Y2), (X1,Y2) and (X2,Y1) are always
As all the points lie on the same line this implies that area of the triangle formed by the points is zero.
So,using area formula in determinant form
X1∗(Y2−Y3)−X2∗(Y1−Y3)+X3∗(Y1−Y2)=0
X1∗(Y2−Y3)+X2∗(Y3−Y1)+X3∗(Y1−Y2)=0
Now,divide both sides by X1∗X2∗X3
(Y2−Y3)+X2∗(Y3−Y1)+X3∗(Y1−Y2)=0
Y2−Y3X2−X3+Y3−Y1X3−X1+Y1−Y2X1−X2=0
Its collinear.