Problem:
Consider the points A(0,12),B(10,9),C(8,0), and D(−4,7). There is a unique square S such that each of the four points is on a different side of S. Let K be the area of S. Find the remainder when 10K is divided by 1000.
Solution:
Because AC and BD intersect, A and C must be on opposite sides of the square, as must B and D. Name the vertices of the square P,Q,R, and S so that A is on PQ​,B is on QR​,C is on RS, and D is on SP. Let h and v represent the horizontal and vertical change, respectively, from P to Q. Then A′, the projection of A onto RS, has coordinates (0+v,12−h). Let M be the midpoint of AC. Then M has coordinates (4,6) and MA=MA′, so 42+62=(v−4)2+(h−6)2. Similarly, D′, the projection of D onto QR​, has coordinates (−4+h,7+v),N, the midpoint of BD, has coordinates (3,8), and ND=ND′, so 72+12=(h−7)2+(v−1)2. The two equations imply that 12h+8v=h2+v2=14h+2v, and so h=3v. Then 12h+8v=h2+v2 yields 36v+8v=(3v)2+v2, so v=44/10. Thus K=h2+v2=10v2=10(442/102)=1936/10, so 10K=1936, and the requested remainder is 936​.
OR
Let m be the slope of the side of the square containing B. The line containing this side has equation y−9=m(x−10) or mx−y+(9−10m)=0. Similarly, the line containing the side containing C has equation y=(−1/m)(x−8) or x+my−8=0. Because the distance from D to the first line is equal to the distance from A to the second line,
Solve to obtain m=5/13 or m=−3. For the square obtained with the first slope, some of the points are on extended sides of the square. This is because A and C are on opposite sides of the line with slope 5/13 that contains B. Thus m=−3. Then K=m2+1(12m−8)2​=442/10, so 10K=1936, and the requested remainder is 936​ .
Query: For four arbitrary points A,B,C,D in the plane, what are the necessary and sufficient conditions that a unique square S exists?