Created
June 27, 2021 10:16
-
-
Save shravanasati/4416f3ee93aa0493a18a335d8c866b0e to your computer and use it in GitHub Desktop.
A python script which creates a 69 using turtle.
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
import turtle, random | |
from math import * | |
t = turtle.Turtle() | |
turtle.bgcolor("black") | |
t.speed(3000000) | |
t.pensize(5) | |
for i in range(1, 200): | |
t.color(random.choice(["red", "white", "blue", "green", "yellow", "violet"])) | |
t.forward(30) | |
t.left(i) | |
t.left(sin(i) * cos(i) * tan(i)) | |
t.penup() | |
t.forward(100) | |
t.pendown() | |
for i in range(1, 200): | |
t.color(random.choice(["red", "white", "blue", "green", "yellow", "violet"])) | |
t.forward(30) | |
t.left(sin(i) * cos(i) * tan(i)) | |
t.left(i) | |
turtle.done() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it is very interesting to see math functions create these spirals, also turtle helps it to be created without any dependencies, also easier to set up. 👍 , thanks @Shravan-1908 for the gist.