Advertisement
luizaspan

introfiscomp - lista1 - questao9

Apr 8th, 2015
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.83 KB | None | 0 0
  1. // Dado um ângulo em graus, minutos e segundos (exemplo: 31◦ 12′ 73′′), converta ele para radianos.
  2.  
  3. // In a full circle there are 360 degrees. Each degree is split up into 60 parts, each part being 1/60 of a degree. These parts are called minutes. Each minute is split up into 60 parts, each part being 1/60 of a minute. These parts are called seconds.
  4.  
  5. // círculo: 360 graus. 1/60 graus = minutos. 1/60 minutos = segundos.
  6.  
  7. #include <stdio.h>
  8. #include <math.h>
  9. #define pi M_PI
  10.  
  11.  
  12. int main(void)
  13. {
  14.  
  15.   double grau,g,min,rad,s,m;
  16.   printf("\nDigite o ângulo deste modo: grauºminuto'segundo''. \n");
  17.   scanf("%lfº%lf'%lf''",&grau,&min,&s);
  18.  
  19.   s=(1/60)*m;
  20.   m=min+s;
  21.   min=(1/60)*g;
  22.   g=(pi/180)*rad+min;
  23. rad=
  24.  
  25.  y=
  26.  
  27.  
  28.   printf("\nO ângulo correspondente em radianos é: %lf \n\n",rad);
  29.  
  30.   return 0;
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement