Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

SnakeCurve goes through grid cells now

Grant Sanderson8f8eeea870c2
diff --git a/hilbert/curves.py b/hilbert/curves.py
index fc547fc0e..65561fd27 100644
--- a/hilbert/curves.py
+++ b/hilbert/curves.py
@@ -270,10 +270,11 @@ class SnakeCurve(SpaceFillingCurve):
def get_anchor_points(self):
result = []
resolution = 2**self.order
+ step = 2.0*self.radius / resolution
lower_left = ORIGIN + \
- LEFT*self.radius + \
- DOWN*self.radius
- step = 2.0*self.radius / (resolution-1)
+ LEFT*(self.radius - step/2) + \
+ DOWN*(self.radius - step/2)
+
for y in range(resolution):
x_range = range(resolution)
if y%2 == 0: