Spaces:
Paused
Paused
up
Browse files
crazy_functions/数学动画生成manim.py
CHANGED
@@ -162,45 +162,4 @@ class MyAnimation(Scene):
|
|
162 |
self.wait()
|
163 |
|
164 |
```
|
165 |
-
|
166 |
-
```
|
167 |
-
# SinAndCosFunctionPlot
|
168 |
-
class MyAnimation(Scene):
|
169 |
-
def construct(self):
|
170 |
-
axes = Axes(
|
171 |
-
x_range=[-10, 10.3, 1],
|
172 |
-
y_range=[-1.5, 1.5, 1],
|
173 |
-
x_length=10,
|
174 |
-
axis_config={"color": GREEN},
|
175 |
-
x_axis_config={
|
176 |
-
"numbers_to_include": np.arange(-10, 10.01, 2),
|
177 |
-
"numbers_with_elongated_ticks": np.arange(-10, 10.01, 2),
|
178 |
-
},
|
179 |
-
tips=False,
|
180 |
-
)
|
181 |
-
axes_labels = axes.get_axis_labels()
|
182 |
-
sin_graph = axes.plot(lambda x: np.sin(x), color=BLUE)
|
183 |
-
cos_graph = axes.plot(lambda x: np.cos(x), color=RED)
|
184 |
-
|
185 |
-
sin_label = axes.get_graph_label(
|
186 |
-
sin_graph, "\\sin(x)", x_val=-10, direction=UP / 2
|
187 |
-
)
|
188 |
-
cos_label = axes.get_graph_label(cos_graph, label="\\cos(x)")
|
189 |
-
|
190 |
-
vert_line = axes.get_vertical_line(
|
191 |
-
axes.i2gp(TAU, cos_graph), color=YELLOW, line_func=Line
|
192 |
-
)
|
193 |
-
line_label = axes.get_graph_label(
|
194 |
-
cos_graph, "x=2\pi", x_val=TAU, direction=UR, color=WHITE
|
195 |
-
)
|
196 |
-
|
197 |
-
plot = VGroup(axes, sin_graph, cos_graph, vert_line)
|
198 |
-
labels = VGroup(axes_labels, sin_label, cos_label, line_label)
|
199 |
-
self.add(plot, labels)
|
200 |
-
|
201 |
-
```
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
"""
|
|
|
162 |
self.wait()
|
163 |
|
164 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
"""
|