Skip to content

Instantly share code, notes, and snippets.

@uwezi
Last active March 19, 2023 13:19
Show Gist options
  • Save uwezi/4968475f9da3a2ea89bb08c3086fd623 to your computer and use it in GitHub Desktop.
Save uwezi/4968475f9da3a2ea89bb08c3086fd623 to your computer and use it in GitHub Desktop.
[Apply matrix to objects] Deforming the number plane and objects using a matrix. #manim #applymatrix #linalg #animate
# https://discord.com/channels/581738731934056449/1025492231035039764/1025695274817028096
from manim import *
class ApplyMatrixExample(Scene):
def construct(self):
m1 = [[1, 1], [0, 2/3]]
m2 = [[0, -2], [-1, -2/3]]
np = NumberPlane()
txt = Text("Hello World!")
self.play(ApplyMatrix(m1, txt), ApplyMatrix(m1, np))
self.wait(2)
self.play(ApplyMatrix(m2, txt), ApplyMatrix(m2, np))
self.wait(2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment