Skip to content

Instantly share code, notes, and snippets.

@jaddoescad
Created March 10, 2019 00:06
Show Gist options
  • Save jaddoescad/cdc6b26159a3f5ec9951e53263a6d067 to your computer and use it in GitHub Desktop.
Save jaddoescad/cdc6b26159a3f5ec9951e53263a6d067 to your computer and use it in GitHub Desktop.
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
(2,-1,0), #P5
(1,-1,0) #P6
]
poly = Polygon(*Hexagon)
animation = Rotate(poly, angle=math.radians(180), in_place=True)
self.play(animation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment