Advertisement
MI5TONER

Untitled

Nov 25th, 2023
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.93 KB | None | 0 0
  1. function Plot_Trajectory(Rm, h_isl, x_list, y_list, x_special, y_special)
  2.     figure('Name', "Траектория");
  3.     hold on;
  4.  
  5.     % Луна
  6.     theta = linspace(deg2rad(75), deg2rad(105), 10^3);
  7.     x_moon = Rm * cos(theta);
  8.     y_moon = Rm * (sin(theta) - 1);
  9.     plot(x_moon, y_moon, 'k');
  10.  
  11.     % Орбита
  12.     x_orb = Rm * cos(theta);
  13.     y_orb = Rm * (sin(theta) - 1) + h_isl;
  14.     plot(x_orb, y_orb, 'k--');
  15.  
  16.     % Траектория
  17.     plot(x_list, y_list, 'b');
  18.  
  19.     % Критические точки
  20.     scatter(x_special, y_special, 'rs');
  21.  
  22.     % Настройка осей и сетки
  23.     grid on;
  24.     grid minor;
  25.     xline(0, 'k--');
  26.     yline(0, 'k--');
  27.     axis equal;
  28.     xlabel('x, [m]');
  29.     ylabel('y, [m]');
  30.     title('Траектория СВ');
  31.     legend('Луна', 'Орбита', 'Траектория СВ', 'Особые точки', 'Location', 'Northwest');
  32.  
  33.     hold off;
  34. end
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement