fork download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. #ifndef M_PI
  5. #define M_PI 3.14159265358979323846
  6. #endif
  7.  
  8. int main(void) {
  9. double csinta = -3, csintb = 10;
  10. double psinta, psintb;
  11.  
  12. psinta=sqrt(csinta*csinta+csintb*csintb);
  13. psintb=atan(csintb/csinta)*180/M_PI;
  14.  
  15. printf ("The values of the polar coordinates are (%.10lf,%.10lf",psinta,psintb+180);
  16.  
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
The values of the polar coordinates are (10.4403065089,106.6992442340