Skip to content

Instantly share code, notes, and snippets.

class DrawCircle(Scene):
def construct(self):
circle = Circle(color=WHITE,radius=1)
self.play(ShowCreation(circle))
@jaddoescad
jaddoescad / draw_circle.py
Last active March 9, 2019 23:05
draw circle in manim
from big_ol_pile_of_manim_imports import *
class DrawCircle(Scene):
def construct(self):
circle = Circle(color=WHITE,radius=1)
self.play(ShowCreation(circle))
@jaddoescad
jaddoescad / set_background.py
Last active April 20, 2021 19:24
change background color in manim
from big_ol_pile_of_manim_imports import *
def set_background(self):
background = Rectangle(
width = FRAME_WIDTH,
height = FRAME_HEIGHT,
stroke_width = 0,
fill_color = "#3E746F",
fill_opacity = 1)
self.add(background)
@jaddoescad
jaddoescad / draw_line.py
Created March 9, 2019 23:08
draw line in manim
from big_ol_pile_of_manim_imports import *
class DrawLine(Scene):
def construct(self):
START = (0,0,0)
END = (4,0,0)
line = Line(START,END);
self.play(ShowCreation(line))
@jaddoescad
jaddoescad / draw_rectangle.py
Created March 9, 2019 23:15
Draw rectangle with manim
from big_ol_pile_of_manim_imports import *
class DrawRectangle(Scene):
def construct(self):
rect = Rectangle(height=3,width=4)
self.play(ShowCreation(rect))
@jaddoescad
jaddoescad / draw_polygon.py
Created March 9, 2019 23:19
drawing a polygon with manim
from big_ol_pile_of_manim_imports import *
class DrawPolygon(Scene):
def construct(self):
Hexagon = [(0,0,0), #P1
(1,1,0), #P2
(2,1,0), #P3
(3,0,0), #P4
(2,-1,0), #P5
(1,-1,0) #P6
@jaddoescad
jaddoescad / draw_vector.py
Created March 9, 2019 23:38
draw vector in manim
from big_ol_pile_of_manim_imports import *
# Move shapes
class DrawVector(Scene):
def construct(self):
vector = Vector(direction=UP)
self.play(ShowCreation(vector))
@jaddoescad
jaddoescad / draw_arc.py
Created March 9, 2019 23:42
Draw arc with manim
from big_ol_pile_of_manim_imports import *
# Move shapes
class DrawArc(Scene):
def construct(self):
angle = math.radians(180)
arc = Arc(radius=2,angle=angle)
self.play(ShowCreation(arc))
@jaddoescad
jaddoescad / move_circle.py
Created March 9, 2019 23:49
Move circle with manim
from big_ol_pile_of_manim_imports import *
# Move shapes
class MoveCircle(Scene):
def construct(self):
circle = Circle(radius=1,color=RED)
end_point = (3,0,0)
animation = ApplyMethod(circle.shift, end_point)
self.play(animation)
@jaddoescad
jaddoescad / move_vector.py
Created March 9, 2019 23:53
move vector with manim
from big_ol_pile_of_manim_imports import *
# Move shapes
class MoveVector(Scene):
def construct(self):
vector = Vector(direction=RIGHT)
end_point = (4,0,0)
animation = ApplyMethod(vector.shift,end_point)
self.play(animation)