Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

compass directions iterator

Grant Sandersond5b463965925
diff --git a/helpers.py b/helpers.py
index 33f09af3b..c4b0d7278 100644
--- a/helpers.py
+++ b/helpers.py
@@ -12,6 +12,13 @@ import re
from constants import *
+def compass_directions(n = 4, start_vect = UP):
+ angle = 2*np.pi/n
+ return [
+ rotate_vector(start_vect, k*angle)
+ for k in range(n)
+ ]
+
def bezier(points):
n = len(points) - 1
return lambda t : sum([