ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1111. Squares

My AC. But i don't understand...
Posted by AleRD 18 Nov 2012 02:29
I have found two other points of square by this formula
 xc = (x1 + x3) / 2.0;
 yc = (y1 + y3) / 2.0;
 dx = (x3 - x1) / 2.0;
 dy = (y3 - y1) / 2.0;
 x2 = xc - dy;
 y2 = yc + dx;
 x4 = xc + dy;
 y4 = yc - dx;
But i could not understood why this works.

Then I use vector product to determine position of point etc.

Can someone explain me ?