Advertisement
luizaspan

oblato nuclear teste

Aug 17th, 2017
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.57 KB | None | 0 0
  1. // definir variáveis beta, gamma, theta, phi
  2.  
  3. // beta=0.8
  4. // gamma=0 (graus)
  5.  
  6. // com theta variando entre 0 e phi e phi variando entre 0 e 2pi
  7.  
  8. // expressão
  9.  
  10. // print lista r theta phi
  11.  
  12.  
  13. #include <stdio.h>
  14. #include <math.h>
  15.  
  16.  
  17. #define M_PI 3.14159265358979323846
  18.  
  19. int main()
  20. {
  21.     double b, g, t, p, r;
  22.  
  23.     b=0.8;
  24.     g=0;
  25.  
  26.     for (t=0 ; t<=(M_PI/2) ; t+=1)
  27.     {
  28.         for (p = 0; p <= (2*M_PI); p+=1)
  29.         {
  30.             r = 1.0 + b*sqrt(5/(16*M_PI)*(cos(g)*(3*pow(cos(t),2)-1)+(sqrt(3)/2)*sin(g)*pow(sin(t),2)*cos(2*p)));
  31.  
  32.             printf("%f %f %f\n",r,t,g);
  33.         }
  34.     }
  35.  
  36.     return 0;
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement