https://discord.com/channels/581738731934056449/1021439985615913051/1021439985615913051
Last active
March 19, 2023 12:33
-
-
Save uwezi/8a59b8e7c7b34a117be3626bd336e080 to your computer and use it in GitHub Desktop.
[Fold line to square] How to make a square from a single line. #manim #fold #animate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://discord.com/channels/581738731934056449/1021439985615913051/1021439985615913051 | |
from manim import * | |
class square_from_line(Scene): | |
def construct(self): | |
line1 = Line(start=ORIGIN, end=1*RIGHT) | |
line2 = line1.copy().shift(1*RIGHT) | |
line3 = line2.copy().shift(1*RIGHT) | |
line4 = line3.copy().shift(1*RIGHT) | |
all = VGroup(line1,line2,line3,line4) | |
grp2 = VGroup(line2,line3,line4) | |
grp3 = VGroup(line3,line4) | |
self.play(Write(all)) | |
self.wait(2) | |
self.play(Rotate(grp2, angle=90*DEGREES, about_point=1*RIGHT)) | |
self.play(Rotate(grp3, angle=90*DEGREES, about_point=1*RIGHT+1*UP)) | |
self.play(Rotate(line4, angle=90*DEGREES, about_point=1*UP)) | |
self.wait(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment