Skip to content

Commit cee6479

Browse files
committed
fixed rotation before translation bug and fixed typos in docs
1 parent d8903c7 commit cee6479

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

EXAMPLES.mlx

166 KB
Binary file not shown.
-45 Bytes
Binary file not shown.

planet3D/planet3D.m

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
% See also background, ground_track.
1212
%
1313
% Copyright © 2021 Tamas Kis
14-
% Last Update: 2022-07-06
14+
% Last Update: 2023-05-17
1515
% Website: https://tamaskis.github.io
1616
% Contact: tamas.a.kis@outlook.com
1717
%
@@ -195,8 +195,8 @@
195195
a = conversion_factor*R;
196196
b = a*(1-f);
197197

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

201201
% ------------------------------------------------------------
202202
% Defining surfaces/coordinates needed to draw celestial body.
@@ -272,6 +272,14 @@
272272
z_coast = new_coordinates(3,:);
273273
end
274274

275+
% ---------------------
276+
% Performs translation.
277+
% ---------------------
278+
279+
planet_surface.XData = planet_surface.XData+position(1);
280+
planet_surface.YData = planet_surface.YData+position(2);
281+
planet_surface.ZData = planet_surface.ZData+position(3);
282+
275283
% --------------------------------------------------------------
276284
% Drawing additional lines (i.e. coastlines or rings of Saturn).
277285
% --------------------------------------------------------------

0 commit comments

Comments
 (0)