Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- cin>>t;
- for(int i=1;i<=t;i++)
- {
- long long int ox,oy,ax,ay,bx,by;
- double angle,ao,bo,ab,s;
- cin>>ox>>oy>>ax>>ay>>bx>>by;
- ao=sqrt(((ox-ax)*(ox-ax))+((oy-ay)*(oy-ay)));
- bo=sqrt(((ox-bx)*(ox-bx))+((oy-by)*(oy-by)));
- ab=sqrt(((ax-bx)*(ax-bx))+((ay-by)*(ay-by)));
- angle=(acos(((ao*ao)+(bo*bo)-(ab*ab))/(2*ao*bo)));
- s=ao*angle;
- printf("Case %d: %.10lf\n",i,s);
- }return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement