mirror of
https://github.com/jeertmans/manim-slides.git
synced 2025-06-07 03:49:00 +08:00
[pre-commit.ci] pre-commit autoupdate (#270)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.287 → v0.0.288](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.287...v0.0.288) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
![66853113+pre-commit-ci[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
GitHub

parent
9a23296fa2
commit
859d48ad2e
@ -20,11 +20,11 @@ repos:
|
|||||||
exclude: poetry.lock
|
exclude: poetry.lock
|
||||||
args: [--autofix]
|
args: [--autofix]
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 23.7.0
|
rev: 23.9.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.0.287
|
rev: v0.0.288
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [--fix]
|
args: [--fix]
|
||||||
|
@ -132,22 +132,22 @@ directly write the `construct` method in the body of `MovingCameraSlide`.
|
|||||||
|
|
||||||
from manim import *
|
from manim import *
|
||||||
from manim_slides import Slide
|
from manim_slides import Slide
|
||||||
|
|
||||||
|
|
||||||
class MovingCameraSlide(Slide, MovingCameraScene):
|
class MovingCameraSlide(Slide, MovingCameraScene):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class SubclassExample(MovingCameraSlide):
|
class SubclassExample(MovingCameraSlide):
|
||||||
def construct(self):
|
def construct(self):
|
||||||
self.camera.frame.save_state()
|
self.camera.frame.save_state()
|
||||||
|
|
||||||
ax = Axes(x_range=[-1, 10], y_range=[-1, 10])
|
ax = Axes(x_range=[-1, 10], y_range=[-1, 10])
|
||||||
graph = ax.plot(lambda x: np.sin(x), color=WHITE, x_range=[0, 3 * PI])
|
graph = ax.plot(lambda x: np.sin(x), color=WHITE, x_range=[0, 3 * PI])
|
||||||
|
|
||||||
dot_1 = Dot(ax.i2gp(graph.t_min, graph))
|
dot_1 = Dot(ax.i2gp(graph.t_min, graph))
|
||||||
dot_2 = Dot(ax.i2gp(graph.t_max, graph))
|
dot_2 = Dot(ax.i2gp(graph.t_max, graph))
|
||||||
self.add(ax, graph, dot_1, dot_2)
|
self.add(ax, graph, dot_1, dot_2)
|
||||||
|
|
||||||
self.play(self.camera.frame.animate.scale(0.5).move_to(dot_1))
|
self.play(self.camera.frame.animate.scale(0.5).move_to(dot_1))
|
||||||
self.next_slide()
|
self.next_slide()
|
||||||
self.play(self.camera.frame.animate.move_to(dot_2))
|
self.play(self.camera.frame.animate.move_to(dot_2))
|
||||||
|
Reference in New Issue
Block a user