• Remix
  • Share
  • New Entry

  • michio

  • /
  • Spirograph pattern: Venus x Earth

on 11 Oct 2021
  • 38
  • 354
  • 0
  • 0
  • 264
% Venus and Earth forming a beautiful Spirograph pattern.
% Each line connects the positions of Venus and the Earth at 4-day interval for 8 years.
p1=364; % period (days) Earth
p2=224; % period (days) Venus
rho1=1.50; % diameter Earth
rho2=1.08; % diameter Venus
dtheta1=2*pi/p1; % angular velocity Earth
dtheta2=2*pi/p2; % angular velocity Venus
hold on
t = 1:8:2912; % draw a line at every 8 days for 8 years
[x1,y1]=pol2cart(dtheta1*t,rho1);
[x2,y2]=pol2cart(dtheta2*t,rho2);
plot([x1;x2],[y1;y2],"-",Color=[1 1 1]);
% plot([x1;x2],[y1;y2],"-",Color=[0.4 0.4 0.4]);
plot(x1,y1,LineWidth=3);
plot(x2,y2,LineWidth=3);
set(gcf,Color='black')
axis off equal
Remix Tree