You are an assistant that knows about Manim. Manim is a mathematical animation…
- User
System: You are an assistant that knows about Manim. Manim is a mathematical animation engine that is used to create videos programmatically.
The following is an example of the code: ``` from manim import * from math import *
class GenScene(Scene): def construct(self): c = Circle(color=BLUE) self.play(Create(c)) ```
Rules
- Always use GenScene as the class name, otherwise, the code will not work.
- Always use self.play() to play the animation, otherwise, the code will not work.
- Do not use text to explain the code, only the code.
- Do not explain the code, only the code.
User: Animation Request: draw a solar system inlude the sun and the earth, draw the orbit of the earth around the sun User: Animation Request: draw a solar system inlude the sun and the earth, draw the orbit of the earth around the sun Assistant: class GenScene(Scene): def construct(self): SUN = Circle/color=Yellow/) EARTH = Circle(radius=0.6, color=GREEN) ORBIT = Arc(years=1, color=RED) self.play(Create(SUN), Create(EARTH), Create(ORBIT)) User: Animation Request: again User: Animation Request: again Assistant: ```python class GenScene(Scene): def construct(self): sun = Circle(radius=1, color=YELLOW) earth = Circle(radius=0.3, color=BLUE) orbit = Circle(radius=3, color=WHITE, fill_opacity=0)
self.play(Create(sun)) self.play(Create(orbit)) self.play(Create(earth)) self.play(Rotate(earth, angle=TAU, run_time=5, rate_func=linear))User: Animation Request: draw the solar system include the sun and the earth, draw the transfer of the earth around the sun User: Animation Request: draw the solar system include the sun and the earth, draw the transfer of the earth around the sun Assistant: ```python class GenScene(Scene): def construct(self): sun = Circle(radius=1, color=YELLOW).shift(ORIGIN) earth = Circle(radius=0.2, color=BLUE).shift(RIGHT * 3) orbit = Circle(radius=3, color=WHITE, fill_opacity=0) self.play(Create(sun)) self.play(Create(orbit)) self.play(Create(earth)) self.play(Rotate(earth, angle=TAU, about_point=sun.get_center(), run_time=5, rate_func=linear))User: Animation Request: make the video 3d User: Animation Request: make the video 3d Assistant: ```python class GenScene(ThreeDScene): def construct(self): sun = Sphere(radius=1, color=YELLOW).shift(ORIGIN) earth = Sphere(radius=0.3, color=BLUE).shift(RIGHT * 3) orbit = Circle(radius=3, color=WHITE, fill_opacity=0).shift(ORIGIN).rotate(PI / 2, axis=RIGHT)
self.add(sun) self.play(Create(orbit)) self.play(Create(earth)) self.move_camera(phi=75*DEGREES, theta=30*DEGREES) self.begin_ambient_camera_rotation(rate=0.1) self.play(Rotate(earth, angle=TAU, about_point=sun.get_center(), run_time=10, rate_func=linear))User: Animation Request: change the color of the sun by orange User: Animation Request: change the color of the sun by orange Assistant: ```python class GenScene(ThreeDScene): def construct(self): sun = Sphere(radius=1, color=ORANGE).shift(ORIGIN) earth = Sphere(radius=0.3, color=BLUE).shift(RIGHT * 3) orbit = Circle(radius=3, color=WHITE, fill_opacity=0).shift(ORIGIN).rotate(PI / 2, axis=RIGHT) self.add(sun) self.play(Create(orbit)) self.play(Create(earth)) self.move_camera(phi=75*DEGREES, theta=30*DEGREES) self.begin_ambient_camera_rotation(rate=0.1) self.play(Rotate(earth, angle=TAU, about_point=sun.get_center(), run_time=10, rate_func=linear)) - Assistant
class GenScene(ThreeDScene): def construct(self): sun = Sphere(radius=1, color=ORANGE).shift(ORIGIN) earth = Sphere(radius=0.3, color=BLUE).shift(RIGHT * 3) orbit = Circle(radius=3, color=WHITE, fill_opacity=0).shift(ORIGIN).rotate(PI / 2, axis=RIGHT) self.add(sun) self.play(Create(orbit)) self.play(Create(earth)) self.move_camera(phi=75*DEGREES, theta=30*DEGREES) self.begin_ambient_camera_rotation(rate=0.1) self.play(Rotate(earth, angle=TAU, about_point=sun.get_center(), run_time=10, rate_func=linear))