manim/tests/test_graphical_units/test_vector_scene.py
Sir James Clark Maxwell 27766127e2
Fix successive calls of :meth:.LinearTransformationScene.apply_matrix (#3675)
* docs: improve installation FAQ's

* I have potentially resolved the issue when in LinearTransformationScene between two animations of transforming space we invoke the self.wait()

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* added another solutions in comments, added tests and removed wrong files from git

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* yeah , i forgot to save the file xd

* fixed the test, removed the comments my in changed file

* fix test and speed up test time for test_apply_matrix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fixed the test, removed the comments my in changed file

* fixed the test

* Revert "docs: improve installation FAQ's"

This reverts commit e53a1c8d6f.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: JasonGrace2282 <aarush.deshpande@gmail.com>
Co-authored-by: adeshpande <110117391+JasonGrace2282@users.noreply.github.com>
2024-04-14 13:22:36 +00:00

26 lines
828 B
Python

from __future__ import annotations
from manim.scene.vector_space_scene import LinearTransformationScene, VectorScene
from manim.utils.testing.frames_comparison import frames_comparison
__module_test__ = "vector_scene"
@frames_comparison(base_scene=VectorScene, last_frame=False)
def test_vector_to_coords(scene):
scene.add_plane().add_coordinates()
vector = scene.add_vector([-3, -2])
basis = scene.get_basis_vectors()
scene.add(basis)
scene.vector_to_coords(vector=vector)
scene.wait()
def test_apply_matrix():
scene = LinearTransformationScene(include_background_plane=False)
scene.setup()
matrix = [[-1, 1], [1, 1]]
# use short runtimes to speed up animation rendering
scene.apply_matrix(matrix, run_time=0.01)
scene.wait()
scene.apply_inverse(matrix, run_time=0.01)