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 the solar system, include sun, earth and mars. draw the transfer around the sun User: Animation Request: draw the solar system, include sun, earth and mars. draw the transfer around the sun Assistant: ```python from manim import *
class GenScene(Scene): def construct(self): sun = Circle(radius=0.5, color=YELLOW).shift(ORIGIN) earth = Circle(radius=0.2, color=BLUE).shift(RIGHT * 3) mars = Circle(radius=0.15, color=RED).shift(RIGHT * 4)
earth_orbit = Circle(radius=3, color=WHITE, stroke_width=1, fill_opacity=0) mars_orbit = Circle(radius=4, color=WHITE, stroke_width=1, fill_opacity=0) self.play(Create(sun), Create(earth_orbit), Create(mars_orbit)) self.play(Create(earth), Create(mars)) earth_path = Arc(radius=3, angle=TAU, color=GREEN) mars_path = Arc(radius=4, angle=TAU, color=ORANGE) self.play(Create(earth_path), Create(mars_path)) self.play(MoveAlongPath(earth, earth_path), MoveAlongPath(mars, mars_path))User: Animation Request: User: Animation Request: Assistant: ```python from manim import * class GenScene(Scene): def construct(self): sun = Circle(radius=0.5, color=YELLOW).shift(ORIGIN) earth = Circle(radius=0.2, color=BLUE).shift(RIGHT * 3) mars = Circle(radius=0.15, color=RED).shift(RIGHT * 4) earth_orbit = Circle(radius=3, color=WHITE, stroke_width=1, fill_opacity=0) mars_orbit = Circle(radius=4, color=WHITE, stroke_width=1, fill_opacity=0) self.play(Create(sun), Create(earth_orbit), Create(mars_orbit)) self.play(Create(earth), Create(mars)) earth_path = Arc(radius=3, angle=TAU, color=GREEN) mars_path = Arc(radius=4, angle=TAU, color=ORANGE) self.play(Create(earth_path), Create(mars_path)) self.play(MoveAlongPath(earth, earth_path), MoveAlongPath(mars, mars_path))User: Animation Request: make this make them into 3d User: Animation Request: make this make them into 3d Assistant: ```python from manim import *
class GenScene(ThreeDScene): def construct(self): self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES)
sun = Sphere(radius=0.5, color=YELLOW).move_to(ORIGIN) earth = Sphere(radius=0.2, color=BLUE).move_to(RIGHT * 3) mars = Sphere(radius=0.15, color=RED).move_to(RIGHT * 4) earth_orbit = Circle(radius=3, color=WHITE, stroke_width=1).rotate(PI/2, axis=RIGHT) mars_orbit = Circle(radius=4, color=WHITE, stroke_width=1).rotate(PI/2, axis=RIGHT) self.play(Create(sun), Create(earth_orbit), Create(mars_orbit)) self.play(Create(earth), Create(mars)) earth_path = Circle(radius=3).rotate(PI/2, axis=RIGHT) mars_path = Circle(radius=4).rotate(PI/2, axis=RIGHT) self.play(MoveAlongPath(earth, earth_path, rate_func=linear, run_time=8), MoveAlongPath(mars, mars_path, rate_func=linear, run_time=12)) - Assistant
from manim import * class GenScene(ThreeDScene): def construct(self): self.set_camera_orientation(phi=75 * DEGREES, theta=30 * DEGREES) sun = Sphere(radius=0.5).set_color(ORANGE).move_to(ORIGIN) earth = Sphere(radius=0.2).set_color(GREEN).move_to(RIGHT * 3) mars = Sphere(radius=0.15).set_color(PURPLE).move_to(RIGHT * 4) earth_orbit = Circle(radius=3, color=WHITE, stroke_width=1).rotate(PI/2, axis=RIGHT) mars_orbit = Circle(radius=4, color=WHITE, stroke_width=1).rotate(PI/2, axis=RIGHT) self.play(Create(sun), Create(earth_orbit), Create(mars_orbit)) self.play(Create(earth), Create(mars)) earth_path = Circle(radius=3).rotate(PI/2, axis=RIGHT) mars_path = Circle(radius=4).rotate(PI/2, axis=RIGHT) self.play(MoveAlongPath(earth, earth_path, rate_func=linear, run_time=8), MoveAlongPath(mars, mars_path, rate_func=linear, run_time=12))