Advertisement
rnort

Untitled

Apr 5th, 2012
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. #define PI 3.141592653589793
  5.  
  6. int main(void)
  7. {
  8.     double a = 0.0, b = 0.0;
  9.     scanf("%lf %lf", &a, &b);
  10.  
  11.     double s60 = sin(PI/3);
  12.     double c60 = cos(PI/3);
  13.  
  14.     double r = 0;
  15.    
  16.     r = ((2*a+b)*sqrt( (a*a+ (a+b)*(a+b) - 2*a*(a+b)*c60)*( (b*b+ (a+b)*(a+b) - 2*b*(a+b)*c60) ) )) / (2 * (2*a+b)*b*s60);
  17.     printf("%.8lf", r);
  18.     fflush(stdin);
  19.     getc(stdin);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement