luizaspan icon

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

luizaspan | PRO | 10/02/15 07:42:59 PM UTC | 0 ⭐ | 728 👁️ | Never ⏰ | []
C |

490 B

|

None

|

0 👍

/

0 👎

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
 
#define pi M_PI
 
#define dt 0.01745329252
 
double rad(double x) {
    return x*pi/180;
}
 
int main(int argc, char *argv[])
{
    double t1, t11, t2, t22, m;
    double n = atof(argv[1]);   // ./a.out n
 
    for (t2=0;t2<=90;t2+=5) 
    {
        t22 = rad(t2) + dt;
        t1 = asin(sin(rad(t2))/n);
        t11 = asin(sin(t22)/n);
 
        m = (tan(t1)-tan(t11))/(tan(rad(t2))-tan(t22));
 
        printf("%lf %lf %lf %lf %lf \n",t2,t22,t1,t11,m);
    }
    return 0;
}

Comments