Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- struct Point
- {
- int X,Y;
- };
- Point A,B,C,P;
- long long DPA,DPB,DPC,DA,DB,DC,A1,A2,B1,B2,C1,C2;
- int main()
- {
- cin>>A.X>>A.Y>>B.X>>B.Y>>C.X>>C.Y>>DPA>>DPB>>DPC;
- DA=DPA-(A.X)*(A.X)-(A.Y)*(A.Y);
- DB=DPB-(B.X)*(B.X)-(B.Y)*(B.Y);
- DC=DPC-(C.X)*(C.X)-(C.Y)*(C.Y);
- A1=2*B.X-2*A.X;
- A2=2*C.X-2*A.X;
- B1=2*B.Y-2*A.Y;
- B2=2*C.Y-2*A.Y;
- C1=DA-DB;
- C2=DA-DC;
- P.X=(C1*B2-B1*C2)/(A1*B2-B1*A2);
- P.Y=(A1*C2-C1*A2)/(A1*B2-B1*A2);
- cout<<P.X<<" "<<P.Y;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement