Created
May 3, 2020 15:08
-
-
Save RobotGyal/bf3c3c0edf86b27b94aa261a1480f28d to your computer and use it in GitHub Desktop.
Cantor Fractal code for Processing.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def setup(): | |
size(500,500) | |
cantor(10, 20, width-20); | |
def cantor(x, y, len): | |
strokeWeight(3) | |
if len >=1: | |
line(x, y, x+len, y) | |
y+=20 | |
cantor(x, y, len/3) | |
cantor(x+len*2/3, y, len/3) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment