A list,

The story of the goddess of the Moon with bright attitude and gorgeous color eulogy, praise the e, and the ancient literature about the goddess of the moon compared, visible people on the story of the Goddess of the moon did a lot of processing, modification, so that the image of the goddess of the moon with the United States, so that it accords with the pursuit of the United States. With modern spread very wide “chang e run to the moon” contrary, “on the whole ancient literature” series “Ling Xian” is recorded “Chang e change the frog” story: “Chang e, Yi wife also, steal the queen mother undead medicine to take, run to the moon. Will go, a yellow. Huang Zhanzhi said, “Ji, pian-pian, returning to my sister, is on her way to the west alone. ‘The goddess of the Moon then held up in the moon, is for the toad.” Chang e into a toad, in the palace all day long was punished pound not dead medicine, live a lonely life, Li Shangyin had a poem sigh Chang e: “Chang e should regret to steal elixins, blue sea blue sky heart every night.” This paper uses the theme of Chang ‘e moon for MATLAB simulation.

Two, some source code

function TaiYang_DiQiu_YueLiang_ChangE clf; cla; clear all; close all; figure('color'.'k');
hold on;
axis equal ;
axis off;
set(gcf,'doublebuffer'.'on');
axis([- 70. 70 - 70. 70]);
theta=0:0.01*pi:2*pi;
t=0.005;
R1=42; % Set the distance between the sun, earth, moon, chang 'e R2=20;
R3=6;
W1=5; % Set the angular velocity of the earth, moon and Chang 'e W2=25;
W3=65;
state1=0; state2=0; state3=0;
plot(0.0.'marker'.'o'.'markersize'.20.'markerfacecolor'.'r'.'markeredgecolor'.'r'); X_DiQiu_GuiJi=R1*cos(theta);
Y_DiQiu_GuiJi=R1*sin(theta);
plot(X_DiQiu_GuiJi,Y_DiQiu_GuiJi,'-b'.'linewidth'.2); H_DiQiu=plot(R1*) H_DiQiu=plot(R1*cos(state1),R1*sin(state1),'marker'.'o'.'markersize'.12.'markerfacecolor'.'b'); H_YueQiu=plot(R1*cos(state1)+R2*cos(state2),R1*sin(state1)+R2*sin(state2),'marker'.'o'.'markersize'.8.'markerfacecolor'.'m'.'markeredgecolor'.'m');
xx2=R1*cos(state1)+R2*cos(state2); yy2=R1*sin(state1)+R2*sin(state2);
YueLiang_GuiJi=plot(xx2,yy2,'color'.'w'); H_ChangE=plot(R1*cos(state1)+R2*cos(state2)+R3*cos(state3),R1*sin(state1)+R2*sin(state2)+R3*sin(state3),'marker'.'o'.'markersize'.4.'markerfacecolor'.'c'.'markeredgecolor'.'c');

xx3=R1*cos(state1)+R2*cos(state2)+R3*cos(state3); yy3=R1*sin(state1)+R2*sin(state2)+R3*sin(state3);
ChangE_GuiJi=plot(xx3,yy3,'color'.'m'); % save GIF file f= getFrame (GCF); f=frame2im(f); [fmap]=rgb2ind(f,256);
imwrite(f,map.'ChangE_GuiJi.gif'.'delaytime'.0.1.'loopcount',inf);

for i=1:1.3*length(theta)
    x1=R1*cos(state1); y1=R1*sin(state1);
    x2=R1*cos(state1)+R2*cos(state2); y2=R1*sin(state1)+R2*sin(state2); xx2=[xx2 x2]; yy2=[yy2 y2]; x3=R1*cos(state1)+R2*cos(state2)+R3*cos(state3); y3=R1*sin(state1)+R2*sin(state2)+R3*sin(state3); xx3=[xx3 x3]; yy3=[yy3 y3];set(H_DiQiu,'xdata',x1,'ydata',y1) ;
    set(H_YueQiu,'xdata',x2,'ydata',y2) ;
    set(H_ChangE,'xdata',x3,'ydata',y3) ;
    set(YueLiang_GuiJi,'xdata',xx2,'ydata',yy2) ;
    set(ChangE_GuiJi,'xdata',xx3,'ydata',yy3) ;
    state1=state1+W1*t;
    state2=state2+W2*t;
    state3=state3+W3*t;
    pause(0.1); drawnow; % save GIF file f= getFrame (GCF); f=frame2im(f); [fmap]=rgb2ind(f,256);
    imwrite(f,map.'ChangE_GuiJi.gif'.'delaytime'.0.1.'writemode'.'append');
end
Copy the code

3. Operation results

Matlab version and references

1 matlab version 2014A

2 Reference [1] Menyunge. MATLAB Physical Computation and Visualization [M]. Tsinghua University Press, 2013. [2] MEI Zhonglei, LI Yuee, MA Aning. MATLAB Electromagnetic Field and Microwave Technology Simulation [M]. Tsinghua University Press, 2020. [3] XU Guobao, ZHANG Bing, SHI Limei, Wu Fan. MATLAB/Simulink Authoritative Guide — Development Environment, Programming, System Simulation and Case Study [M]. Tsinghua University Press, 2019. [4] Zhou Qunyi, Hou Zhaoyang, Liu Rangsu. MATLAB Visualization University Physics (2nd edition)[M]. Tsinghua University Press, 2015.