• Remix
  • Share
  • New Entry

on 7 Oct 2021
  • 31
  • 143
  • 0
  • 0
  • 280
% This is a remix of elkman's "Above the earth".
% Planet diameter ratios relative to earth are from
% https://nssdc.gsfc.nasa.gov/planetary/factsheet/planet_table_ratio.html
% Jupiter & Saturn are halved.
s=[.38 .95 0 .53 5.6 4.8 4 3.9];
% Function to draw planets scaled by 's', translated by 't'
% and with colors 'c'.
[x,y,z]=sphere(99);
f=@(s,t,c)surf(x*s+t,y*s,z*s,EdgeC='n',FaceC=c);
% compute translations along x axis so earth is at 0.
t=cumsum([0,s(1:7)+2])+s/2-5.3;
% Define planet colors
c=[9 9 7;9 6 4;0 0 0;9 5 5;8 7 5;9 9 7;3 8 8;0 8 9]/10;
% Plot earth
figure(Color='k');
earthmap;
Name Size Bytes Class Attributes topo 180x360 518400 double topomap1 64x3 1536 double
hold
Current plot held
% Add other planets
for i=1:8
f(s(i)/2,t(i),c(i,:)) %Venus sandy brown
end
% cosmetics
view(2)
axis equal
camva(5)
material dull
Remix Tree