Custom Search

PYTHON: Circles

You have to put in two numbers into the command to define your circle.

- the radius 'r'

- the angle 'a' that is subtended at centre by arc drawn using the command 'circle'

 

import turtle

turtle = turtle.Turtle()

turtle.color("red")

turtle.fillcolor("purple")

turtle.begin_fill()

turtle.circle(200,180)

turtle.end_fill()

 

Above is the code used to draw a semi-circular shape of radius '200'.

The 180 indicates that only half of the circle is to be drawn...

Here are several circles with different thicknesses of line and angle subtended at the centre.