Skip to content

Instantly share code, notes, and snippets.

@jaddoescad
jaddoescad / rotate_rectangle.py
Created March 9, 2019 23:58
Rotate rectangle 90 degrees
from big_ol_pile_of_manim_imports import *
# Animate shapes
class RotateRect(Scene):
def construct(self):
rect = Rectangle(height=1,width=2)
angle = math.radians(90)
animation = Rotate(rect, angle=angle)
self.play(animation)
@jaddoescad
jaddoescad / scale_circle.py
Created March 10, 2019 00:02
Scale circle with manim
from big_ol_pile_of_manim_imports import *
# Animate shapes
class ScaleCircle(Scene):
def construct(self):
circle = Circle(radius=2, fill_color=YELLOW, fill_opacity=1)
self.play(GrowFromCenter(circle))
@jaddoescad
jaddoescad / rotate_polygon.py
Created March 10, 2019 00:06
Rotate polygon with manim
from big_ol_pile_of_manim_imports import *
# Animate shapes
class RotatePolygon(Scene):
def construct(self):
Hexagon = [(0,0,0), #P1
(1,1,0), #P2
(2,1,0), #P3
(3,0,0), #P4
@jaddoescad
jaddoescad / rotate_20.py
Created March 10, 2019 00:35
Rotate with manim for 20 seconds
from big_ol_pile_of_manim_imports import *
# Animate shapes
class RotateSquareForever(Scene):
def construct(self):
square = Square()
rotate = Rotating(square)
self.play(rotate, run_time=20)
@jaddoescad
jaddoescad / transform_line_to_circle.py
Created March 10, 2019 00:44
Transform Line to Circle
from big_ol_pile_of_manim_imports import *
# Animate shapes
class LineToCircle(Scene):
def construct(self):
line = Line((0,0,0), (4,0,0))
arc = Circle(color = WHITE, radius=1)
self.play(ShowCreation(arc))
self.play(Transform(arc, line))
@jaddoescad
jaddoescad / dot_to_line.py
Created March 10, 2019 00:49
Transform dot to line
from big_ol_pile_of_manim_imports import *
# Animate shapes
class DotToLine(Scene):
def construct(self):
dot = Dot()
line = Line((0,0,0), (3,0,0))
self.play(ShowCreation(dot))
self.play(Transform(dot, line))
@jaddoescad
jaddoescad / dot_to_circle.py
Created March 10, 2019 00:52
Transform dot to circle
from big_ol_pile_of_manim_imports import *
# Animate shapes
class DotToCircle(Scene):
def construct(self):
circle = Circle()
dot = Dot()
self.play(ShowCreation(dot))
self.play(Transform(dot, circle))
@jaddoescad
jaddoescad / line_to_square.py
Created March 10, 2019 00:57
Animate Line to Square
from big_ol_pile_of_manim_imports import *
# Animate shapes
class LineToSquare(Scene):
def construct(self):
line = Line((0,0,0),(3,0,0))
square = Rectangle(width=3, height=3)
# OR: square = Square()
self.play(ShowCreation(line))
@jaddoescad
jaddoescad / functional_animations.py
Created March 10, 2019 01:31
animate functions
from big_ol_pile_of_manim_imports import *
# Animate shapes
# Functions and Equations
class PlotFunctionGraph(Scene):
def construct(self):
self.numpy_sin_function()
self.clear()
@jaddoescad
jaddoescad / draw_flag.py
Created March 10, 2019 01:36
Draw flag
from big_ol_pile_of_manim_imports import *
# Animate shapes
# combine and animate complex shapes
class DrawFlag(Scene):
def construct(self):
flag = Rectangle(height=1,width=1.9,stroke_width=1.5,fill_color=DARK_BLUE,fill_opacity=1)
bottom_corner = flag.get_corner(LEFT+DOWN)
pole = Line(bottom_corner,bottom_corner+(DOWN*2.5), stroke_width=1.5)