generated from mwc/project_drawing
Wasnt stuck anywhere too easy fr
This commit is contained in:
278
drawing.py
278
drawing.py
@@ -1,8 +1,8 @@
|
|||||||
# drawing.py
|
# drawing.py
|
||||||
# ----------
|
# ----------
|
||||||
# By ____(you)___________
|
# By Connor
|
||||||
#
|
#
|
||||||
# (Briefly describe what this program does.)
|
# Draws a pattern of hearts
|
||||||
|
|
||||||
from turtle import *
|
from turtle import *
|
||||||
from math import sqrt
|
from math import sqrt
|
||||||
@@ -23,23 +23,269 @@ def quarter_arc_left(radius):
|
|||||||
"Draws a quarter of an arc, turning to the left."
|
"Draws a quarter of an arc, turning to the left."
|
||||||
circle(radius, 90)
|
circle(radius, 90)
|
||||||
|
|
||||||
|
def heart(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
left(90)
|
left(90)
|
||||||
fly(150)
|
fly(200/size)
|
||||||
right(90)
|
|
||||||
left(90)
|
left(90)
|
||||||
quarter_arc_left(100)
|
quarter_arc_right(100/size)
|
||||||
quarter_arc_left(100)
|
quarter_arc_right(100/size)
|
||||||
left(90.)
|
|
||||||
fly(200)
|
|
||||||
left(90)
|
|
||||||
quarter_arc_right(100)
|
|
||||||
quarter_arc_right(100)
|
|
||||||
right(24.6)
|
right(24.6)
|
||||||
forward(480)
|
forward(480/size)
|
||||||
right(90+40.7)
|
right(130.7)
|
||||||
forward(480)
|
forward(480/size)
|
||||||
fly(100)
|
penup()
|
||||||
|
goto(0,0)
|
||||||
|
|
||||||
|
def heart2(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
left(90)
|
||||||
|
fly(200/size)
|
||||||
|
left(90)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
right(24.6)
|
||||||
|
forward(480/size)
|
||||||
|
right(130.7)
|
||||||
|
forward(480/size)
|
||||||
|
penup()
|
||||||
|
goto(200,0)
|
||||||
|
|
||||||
|
def heart3(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
left(90)
|
||||||
|
fly(200/size)
|
||||||
|
left(90)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
right(24.6)
|
||||||
|
forward(480/size)
|
||||||
|
right(130.7)
|
||||||
|
forward(480/size)
|
||||||
|
penup()
|
||||||
|
goto(-200,0)
|
||||||
|
|
||||||
|
def heart4(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
left(90)
|
||||||
|
fly(200/size)
|
||||||
|
left(90)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
right(24.6)
|
||||||
|
forward(480/size)
|
||||||
|
right(130.7)
|
||||||
|
forward(480/size)
|
||||||
|
penup()
|
||||||
|
goto(0,200)
|
||||||
|
|
||||||
|
def heart5(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
left(90)
|
||||||
|
fly(200/size)
|
||||||
|
left(90)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
right(24.6)
|
||||||
|
forward(480/size)
|
||||||
|
right(130.7)
|
||||||
|
forward(480/size)
|
||||||
|
penup()
|
||||||
|
goto(200,200)
|
||||||
|
|
||||||
|
def heart6(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
left(90)
|
||||||
|
fly(200/size)
|
||||||
|
left(90)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
right(24.6)
|
||||||
|
forward(480/size)
|
||||||
|
right(130.7)
|
||||||
|
forward(480/size)
|
||||||
|
penup()
|
||||||
|
goto(-200,200)
|
||||||
|
|
||||||
|
def heart7(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
left(90)
|
||||||
|
fly(200/size)
|
||||||
|
left(90)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
right(24.6)
|
||||||
|
forward(480/size)
|
||||||
|
right(130.7)
|
||||||
|
forward(480/size)
|
||||||
|
penup()
|
||||||
|
goto(200,-200)
|
||||||
|
|
||||||
|
def heart8(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
left(90)
|
||||||
|
fly(200/size)
|
||||||
|
left(90)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
right(24.6)
|
||||||
|
forward(480/size)
|
||||||
|
right(130.7)
|
||||||
|
forward(480/size)
|
||||||
|
penup()
|
||||||
|
goto(0,-200)
|
||||||
|
|
||||||
|
def heart9(size):
|
||||||
|
"The higher the size the smaller it is."
|
||||||
|
pendown()
|
||||||
|
setheading(90)
|
||||||
|
fly(150/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
quarter_arc_left(100/size)
|
||||||
|
left(90)
|
||||||
|
fly(200/size)
|
||||||
|
left(90)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
quarter_arc_right(100/size)
|
||||||
|
right(24.6)
|
||||||
|
forward(480/size)
|
||||||
|
right(130.7)
|
||||||
|
forward(480/size)
|
||||||
|
penup()
|
||||||
|
goto(-200,-200)
|
||||||
|
|
||||||
|
"end of hearts start of heart spirals"
|
||||||
|
|
||||||
|
def heart_spiral(size):
|
||||||
|
heart(10*size)
|
||||||
|
heart(8*size)
|
||||||
|
heart(6*size)
|
||||||
|
heart(4*size)
|
||||||
|
heart(2.5*size)
|
||||||
|
heart(1.5*size)
|
||||||
|
|
||||||
|
def heart_spiral2(size):
|
||||||
|
heart2(10*size)
|
||||||
|
heart2(8*size)
|
||||||
|
heart2(6*size)
|
||||||
|
heart2(4*size)
|
||||||
|
heart2(2.5*size)
|
||||||
|
heart2(1.5*size)
|
||||||
|
|
||||||
|
def heart_spiral3(size):
|
||||||
|
heart3(10*size)
|
||||||
|
heart3(8*size)
|
||||||
|
heart3(6*size)
|
||||||
|
heart3(4*size)
|
||||||
|
heart3(2.5*size)
|
||||||
|
heart3(1.5*size)
|
||||||
|
|
||||||
|
def heart_spiral4(size):
|
||||||
|
heart4(10*size)
|
||||||
|
heart4(8*size)
|
||||||
|
heart4(6*size)
|
||||||
|
heart4(4*size)
|
||||||
|
heart4(2.5*size)
|
||||||
|
heart4(1.5*size)
|
||||||
|
|
||||||
|
def heart_spiral5(size):
|
||||||
|
heart5(10*size)
|
||||||
|
heart5(8*size)
|
||||||
|
heart5(6*size)
|
||||||
|
heart5(4*size)
|
||||||
|
heart5(2.5*size)
|
||||||
|
heart5(1.5*size)
|
||||||
|
|
||||||
|
def heart_spiral6(size):
|
||||||
|
heart6(10*size)
|
||||||
|
heart6(8*size)
|
||||||
|
heart6(6*size)
|
||||||
|
heart6(4*size)
|
||||||
|
heart6(2.5*size)
|
||||||
|
heart6(1.5*size)
|
||||||
|
|
||||||
|
def heart_spiral7(size):
|
||||||
|
heart7(10*size)
|
||||||
|
heart7(8*size)
|
||||||
|
heart7(6*size)
|
||||||
|
heart7(4*size)
|
||||||
|
heart7(2.5*size)
|
||||||
|
heart7(1.5*size)
|
||||||
|
|
||||||
|
def heart_spiral8(size):
|
||||||
|
heart8(10*size)
|
||||||
|
heart8(8*size)
|
||||||
|
heart8(6*size)
|
||||||
|
heart8(4*size)
|
||||||
|
heart8(2.5*size)
|
||||||
|
heart8(1.5*size)
|
||||||
|
|
||||||
|
def heart_spiral9(size):
|
||||||
|
heart9(10*size)
|
||||||
|
heart9(8*size)
|
||||||
|
heart9(6*size)
|
||||||
|
heart9(4*size)
|
||||||
|
heart9(2.5*size)
|
||||||
|
heart9(1.5*size)
|
||||||
|
|
||||||
|
heart_spiral(3)
|
||||||
|
goto(200,0)
|
||||||
|
heart_spiral2(2)
|
||||||
|
goto(-200,0)
|
||||||
|
heart_spiral3(2)
|
||||||
|
goto(0,200)
|
||||||
|
heart_spiral4(2)
|
||||||
|
goto(200,200)
|
||||||
|
heart_spiral5(2)
|
||||||
|
goto(-200,200)
|
||||||
|
heart_spiral6(2)
|
||||||
|
goto(200,-200)
|
||||||
|
heart_spiral7(2)
|
||||||
|
goto(0,-200)
|
||||||
|
heart_spiral8(2)
|
||||||
|
goto(-200,-200)
|
||||||
|
heart_spiral9(2)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user