MCPcopy Create free account
hub / github.com/CompVis/zigma / peano_curve

Function peano_curve

utils/utils_zigzag.py:308–318  ·  view source on GitHub ↗
(level, x, y, dx, dy)

Source from the content-addressed store, hash-verified

306 import matplotlib.pyplot as plt
307
308 def peano_curve(level, x, y, dx, dy):
309 if level == 0:
310 plt.plot([x, x + dx], [y, y + dy], color="black")
311 else:
312 dx /= 3
313 dy /= 3
314 peano_curve(level - 1, x, y, dx, dy)
315 peano_curve(level - 1, x + dx, y + dy, dx, dy)
316 peano_curve(level - 1, x + 2 * dx, y + dy, dx, dy)
317 peano_curve(level - 1, x + dx, y + 2 * dy, dx, dy)
318 peano_curve(level - 1, x, y + 2 * dy, dx, dy)
319
320 plt.figure(figsize=(6, 6))
321 peano_curve(

Callers 1

draw_pineao_curveFunction · 0.85

Calls 1

plotMethod · 0.45

Tested by

no test coverage detected