Advertisement
luizaspan

[FÍSICA IV] Relação ângulo observação e y'/y

Oct 2nd, 2015
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.49 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3. #include <stdlib.h>
  4.  
  5. #define pi M_PI
  6.  
  7. #define dt 0.01745329252
  8.  
  9. double rad(double x) {
  10.     return x*pi/180;
  11. }
  12.  
  13. int main(int argc, char *argv[])
  14. {
  15.     double t1, t11, t2, t22, m;
  16.     double n = atof(argv[1]);   // ./a.out n
  17.  
  18.     for (t2=0;t2<=90;t2+=5)
  19.     {
  20.         t22 = rad(t2) + dt;
  21.         t1 = asin(sin(rad(t2))/n);
  22.         t11 = asin(sin(t22)/n);
  23.  
  24.         m = (tan(t1)-tan(t11))/(tan(rad(t2))-tan(t22));
  25.  
  26.         printf("%lf %lf %lf %lf %lf \n",t2,t22,t1,t11,m);
  27.     }
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement