Advertisement
a53

xOy

a53
Feb 23rd, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. struct Point
  4. {
  5. int X,Y;
  6. };
  7. Point A,B,C,P;
  8. long long DPA,DPB,DPC,DA,DB,DC,A1,A2,B1,B2,C1,C2;
  9.  
  10. int main()
  11. {
  12. cin>>A.X>>A.Y>>B.X>>B.Y>>C.X>>C.Y>>DPA>>DPB>>DPC;
  13. DA=DPA-(A.X)*(A.X)-(A.Y)*(A.Y);
  14. DB=DPB-(B.X)*(B.X)-(B.Y)*(B.Y);
  15. DC=DPC-(C.X)*(C.X)-(C.Y)*(C.Y);
  16. A1=2*B.X-2*A.X;
  17. A2=2*C.X-2*A.X;
  18. B1=2*B.Y-2*A.Y;
  19. B2=2*C.Y-2*A.Y;
  20. C1=DA-DB;
  21. C2=DA-DC;
  22. P.X=(C1*B2-B1*C2)/(A1*B2-B1*A2);
  23. P.Y=(A1*C2-C1*A2)/(A1*B2-B1*A2);
  24. cout<<P.X<<" "<<P.Y;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement