fork(1) 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. double test;
  12.  
  13. psinta=sqrt(csinta*csinta+csintb*csintb); //Μετατροπή καρτεσιανής συντεταγμένης α σε πολική r = √ (x + y)
  14. test = 10/(-3);
  15. printf("%.10lf", test);
  16. psintb=atan(10/(-3))*180/M_PI;//Μετατροπή καρτεσιανής συντεταγμένης β σε πολική θ = tan-1 ( y / x )
  17.  
  18. printf ("The values of the polar coordinates are (%.10lf,%.10lf",psinta,psintb+180);
  19.  
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
-3.0000000000The values of the polar coordinates are (10.4403065089,108.4349488229