This file contains hidden or 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
| import numpy as np | |
| __author__ = 'Adam' | |
| class Point: | |
| def __init__(self, x, y): | |
| self.x = x | |
| self.y = y |
This file contains hidden or 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
| import random | |
| from PIL import Image | |
| def feigenbaum_diagram(scale=2000, r_ax=None, x_ax=None, name="feigenbaum_diagram.png"): | |
| if not x_ax: | |
| x_ax = [0.0, 1.0] | |
| if not r_ax: | |
| r_ax = [0.0, 1.0] |
This file contains hidden or 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
| import sys | |
| import random | |
| import math | |
| import numpy as np | |
| from PIL import Image | |
| from python.common import line | |
This file contains hidden or 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
| from math import cos, sin, tan | |
| import math | |
| from PIL import Image | |
| def waves(size=500, a=200): | |
| img = Image.new('RGB', (size, size)) | |
| start = - round(size / 2) | |
| end = - start |
This file contains hidden or 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
| from math import pi | |
| from python.common.Turtle import Turtle | |
| def diamond(radius=200): | |
| density = round(radius / 100 * 12) | |
| t = Turtle() | |
| length = (pi * radius) / density | |
| angle = (density - 2) * 180. / density |
This file contains hidden or 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
| from math import sin, radians | |
| from python.common.Turtle import Turtle | |
| def triangles(depth=20, size=200): | |
| t = Turtle() | |
| step = (size * sin(radians(30))) / depth | |
| print(step) |
This file contains hidden or 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
| from math import sqrt | |
| from python.common.Turtle import Turtle | |
| def squares(density=20, radius=200): | |
| t = Turtle() | |
| space = radius * 2 / density | |
| for x in range(-radius, radius, round(space)): | |
| y1 = -sqrt(radius ** 2 - x ** 2) |
This file contains hidden or 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
| from math import tan, radians, sqrt | |
| from python.common.Turtle import Turtle | |
| def squares(depth=50, angle=86, size=500): | |
| t = Turtle() | |
| length = size | |
| for i in range(depth): | |
| for _ in range(4): |
This file contains hidden or 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
| from math import sin, radians, cos | |
| from python.common.Turtle import Turtle | |
| from python.less2.combinatorics import combinations | |
| def pentagram_relative(size=100): | |
| t = Turtle() | |
| t.forward(size) |
This file contains hidden or 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
| from python.common.lsystem import Lsystem | |
| kloch = Lsystem("F--F--F", {"F": "F+F--F+F"}, | |
| {"F": "forward(1)", | |
| "+": "right(60)", | |
| "-": "left(60)"}) | |
| sierpinsky = Lsystem("A", {"A": "B-A-B", "B": "A+B+A"}, | |
| {"A": "forward(3)", | |
| "B": "forward(3)", |