fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. double y=4,x=1,angle=-30;
  8. angle*=M_PI/180;
  9. double py=x*sin(angle)+y*cos(angle);
  10. double px=x*cos(angle)-y*sin(angle);
  11. cout<<px<<' '<<py<<endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
2.86603 2.9641