Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main() {
- int n,i;
- double ox,oy,ax,ay,bx,by,r,x,X,S;
- scanf("%d",&n);
- for(i=1;i<=n;i++){
- scanf("%lf %lf %lf %lf %lf %lf",&ox,&oy,&ax,&ay,&bx,&by);
- x = sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
- r = sqrt((ax-ox)*(ax-ox)+(ay-oy)*(ay-oy));
- X = acos((r*r+r*r-x*x)/(2*r*r));
- S = r*X;
- printf("Case %d: %.5lf\n",i,S);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement