0% found this document useful (0 votes)
2 views

CodingInvestigation

The document outlines a narrative involving two close friends and their journey, represented through geometric shapes and Python coding. It includes various functions for drawing shapes and backgrounds, creating a visual artwork that symbolizes themes like friendship, happiness, and growth. The project is part of a Year 7 Mathematics investigation focusing on geometric relationships and storytelling through art.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

CodingInvestigation

The document outlines a narrative involving two close friends and their journey, represented through geometric shapes and Python coding. It includes various functions for drawing shapes and backgrounds, creating a visual artwork that symbolizes themes like friendship, happiness, and growth. The project is part of a Year 7 Mathematics investigation focusing on geometric relationships and storytelling through art.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Narrative

ovals = free time, playing footy


triangle = control
square = happiness
circle = friendship
tree = tree of life, growing up

This story tells the tale of two close friends. In the beginning there are very
close to each other

from turtle import*


from random import*
speed(0)
#Course: Year 7 Mathematics 2024 - Investigation 2
#Coding Investigation 2 (CAT): Exploring Geometric Relationships with Python
#Your task is to create a “work of art,” using polygons, lines, points (“dots”) and
any of the
#Python resources described above. Your artwork should also have a “narrative”
which links
#the elements of your picture and tells a “story” relating the geometric elements
to represent
#places or locations in the land (Country) and connections between them. For
example, you
#might describe features of your journey from home to school, or another important
aspect of
#your regular routine.

def background():
pencolor('PaleGreen1')
fillcolor('PaleGreen1')
moveto(-50,-125)
begin_fill()
left(129)
circle(95)
right(129)
end_fill()
begin_fill()
polygon(4,100)
end_fill()
forward(100)
begin_fill()
left(51)
circle(-95)
right(51)
end_fill()
moveto(0,0)

def person(size):
circle(size*6)
right(90)
forward(size*5)
left(90)
forward(size*7)
backward(size*14)
forward(size*7)
right(90)
forward(size*10)
left(30)
forward(size*10)
backward(size*10)
right(60)
forward(size*10)
backward(size*10)
left(30)
backward(size*15)
left(90)

def spiral():
for i in range(500):
penup()
forward(i/2)
if i > 100:
dot(4)
right(86)

def draw_oval(x,y,big_radius,small_radius):
moveto(x,y)
circle(big_radius,90)
circle(small_radius,90)
circle(big_radius,90)
circle(small_radius,90)

#draws dot background no.1


# space --> distance between dots
# x --> height of rectangle
# y --> width of rectangle
def draw(space,x,y):
for i in range(x):
for j in range(y):
# dot
dot(4)
# distance for another dot
penup()
forward(space)
pendown()
penup()
backward(space*y)
# direction
right(90)
forward(space)
left(90)
pendown()

#reusable function for drawing polygons such as squares and pentagons


def polygon(sides,sidelength):
angle = 360/sides
for i in range (sides):
forward(sidelength)
right(angle)

#reusable function for going to x,y point


def moveto(x,y):
penup()
goto(x,y)
pendown()

#main section aka drawing the code

#background
pencolor('DodgerBlue')
#spiral background
moveto(0,0)
spiral()
left(160)

#dot background
pensize(2)
pencolor('LightSkyBlue1')
moveto(-200,150)
draw(15,20,27)
#grass hills
background()

#left side
pencolor('LightSalmon4')
pensize(4)

moveto(-150, -75)
#bob
person(2)

moveto(-120, -75)
#jerry
person(2)

#right side
#bob2
moveto(120, -75)
person(2)

#jerry2
moveto(150, -75)
person(2)

pensize(2)

for i in range (80):


moveto(randint(-20,10),randint(-150,0))
polygon(4,20)

pencolor('green3')
moveto(150,150)
for i in range (180):
moveto(randint(-100,100),randint(0,140))
polygon(randint(3,10),randint(10,15))

#symbols and decoration


pensize(3)

#
pencolor('LightSalmon')
draw_oval(-150,40,50,25)
draw_oval(100,100,30,20)

#
pencolor('IndianRed')
moveto(-150, 0)
polygon(3, 20)
moveto(150, 0)
polygon(3, 40)

#
pencolor('OrangeRed')
moveto(-80, 20)
polygon(4, 40)
moveto(80, 20)
polygon(4, 10)

#
pencolor('gray100')
moveto(-70, 50)
circle(15)
moveto(70, 50)
circle(10)

You might also like