L3peha

trajectory

Dec 8th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. double a, b, c, d, t1, t2, tau, mas[1000][2];
  9. int i = 1;
  10. cin >> a >> b >> c >> d >> t1 >> t2 >> tau;
  11. mas[0][0] = t1;
  12. mas[0][1] = a * exp(b * t1) + c * sin(d * t1);
  13. while (t1 + i*tau <= t2)
  14. {
  15. mas[i][0] = mas[i - 1][0] + tau;
  16. mas[i][1] = a * exp(b * mas[i][0]) + c * sin(d * mas[i][0]);
  17. i++;
  18. }
  19. for (int j = 0; j < i; j++)
  20. {
  21. printf("%.4lf", mas[j][0]);
  22. cout << " ";
  23. printf("%.4lf", mas[j][1]);
  24. cout << endl;
  25. }
  26. return 0;
  27. }
Add Comment
Please, Sign In to add comment