Advertisement
Guest User

Untitled

a guest
Feb 11th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. double alfa, pi(3.14159265358979323846), x, y, xi, yi;
  8. int main()
  9. {
  10. cout << "Przeksztalcenie punktu w przestrzeni - obroty wokol osi ukladu kartezjanskiego" << endl;
  11. cout << "Podaj wspolrzedna x: " << endl;
  12. cin >> x;
  13. cout << "Podaj wspolrzedna y: " << endl;
  14. cin >> y;
  15. cout << "Podaj wartosc obrotu kata dookola punku (0,0) w [o]" << endl;
  16. cin >> alfa;
  17.  
  18. alfa=(alfa*pi)/180;
  19.  
  20. xi = x*cos(alfa) - y*sin(alfa);
  21. yi = x*sin(alfa) + y*cos(alfa);
  22.  
  23. cout << "Nowe wspolrzedne x', y' wynosza: (" << xi << "," << yi << ")" << endl;
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement