Skip to content

Commit

Permalink
fixed rotation before translation bug and fixed typos in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaskis committed May 18, 2023
1 parent d8903c7 commit cee6479
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Binary file modified EXAMPLES.mlx
Binary file not shown.
Binary file modified Technical Documentation/Visualizing_Celestial_Bodies_in_3D.pdf
Binary file not shown.
14 changes: 11 additions & 3 deletions planet3D/planet3D.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
% See also background, ground_track.
%
% Copyright © 2021 Tamas Kis
% Last Update: 2022-07-06
% Last Update: 2023-05-17
% Website: https://tamaskis.github.io
% Contact: [email protected]
%
Expand Down Expand Up @@ -195,8 +195,8 @@
a = conversion_factor*R;
b = a*(1-f);

% coordinates of ellipsoid (uses 400 panels)
[x,y,z] = ellipsoid(position(1),position(2),position(3),a,a,b,400);
% coordinates of ellipsoid centered at (0,0,0) using 400 panels
[x,y,z] = ellipsoid(0,0,0,a,a,b,400);

% ------------------------------------------------------------
% Defining surfaces/coordinates needed to draw celestial body.
Expand Down Expand Up @@ -272,6 +272,14 @@
z_coast = new_coordinates(3,:);
end

% ---------------------
% Performs translation.
% ---------------------

planet_surface.XData = planet_surface.XData+position(1);
planet_surface.YData = planet_surface.YData+position(2);
planet_surface.ZData = planet_surface.ZData+position(3);

% --------------------------------------------------------------
% Drawing additional lines (i.e. coastlines or rings of Saturn).
% --------------------------------------------------------------
Expand Down

0 comments on commit cee6479

Please sign in to comment.