scale x,y and z axis to match JPL Database

1 visualización (últimos 30 días)
kim
kim el 22 de Jul. de 2024
Respondida: Arnav el 4 de Sept. de 2024
I am using the NASA JPL Databases and learning how to plot the Three-Body Periodic Orbits using ode45 and my own derivate function. I was wondering if anyone knows how to scale the x,y and z axis to fit in with the JPL Databases. https://ssd.jpl.nasa.gov/tools/periodic_orbits.html

Respuestas (1)

Arnav
Arnav el 4 de Sept. de 2024
Hi @kim,
Based on my understanding, you wish to scale the ranges of all three axes to be same and set limits of the plots such that the whole figure is visible.
The maximum range of the data can be calculated by using the max function as:
max_range = max([max(abs(X)), max(abs(Y)), max(abs(Z))]);
Then, after plotting the data you can set the limits for the axes by using the axis function as:
axis([-max_range, max_range, -max_range, max_range, -max_range, max_range]);
axis equal;
You may refer to the documentation page of axis for more information : https://www.mathworks.com/help/matlab/ref/axis.html#responsive_offcanvas

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by