banner



how to draw a circle in python 3

How to describe circle in Python Turtle

To draw a circle, we volition employ circle() method which takes radius as an argument.

#Program to draw circle in Python Turtle import turtle   t = turtle.Turtle() t.circle(50)

Output of the above program

Circle in Python Turtle

Explanation of the above code

import turtle t = turtle.Turtle()

You must import turtle module in order to use it. And so, we have created a new drawing board and assigned it to an object t.

t.circle(fifty)

It volition draw a circle of radius 50units.

Draw Tangent Circles in Python Turtle

More than i circle having 1 point of intersection is called tangent circles.

#Programme to draw tangent circles in Python Turtle import turtle   t = turtle.Turtle() for i in range(ten):   t.circle(x*i)

Output of the above program-

Tangent Circles in Python Turtle

Explanation of the above code

for i in range(10):   t.circle(10*i)

After drawing a circle, turtle reaches the same bespeak from where it has started drawing a circle. So, just by varying the radius we tin obtain tangent circles. This affair is repeated 10 times to obtain tangent circles.

Draw Spiral Circles in Python Turtle

Circles with varying radius are called spiral.

#Program to draw spiral circles in Python Turtle import turtle   t = turtle.Turtle() for i in range(100):   t.circumvolve(10+i, 45)

Output of the above plan-

Spiral Circles in Python Turtle

Explanation of the above code

for i in range(100):   t.circle(10+i, 45)

The second argument of circle() method helps in drawing an arc. It controls the mensurate of the central bending. Hither we take passed 45 as a central bending. This matter is repeated 100 times to obtain concentric circles.

Draw Concentric Circles in Python Turtle

Circles with unlike radii having a mutual center are called concurrent circles.

#Programme to draw concentric circles in Python Turtle import turtle   t = turtle.Turtle() for i in range(50):   t.circle(10*i)   t.up()   t.sety((10*i)*(-i))   t.down()

Output of the in a higher place program-

Concentric Circles in Python Turtle

Caption of the above code

for i in range(100):   t.circle(10*i)   t.up()   t.sety((10*i)*(-one))   t.down()

Later drawing a circle, we have picked upwards the turtle's pen and set the y coordinate of turtle'southward pen to -1 times x*i. Afterward which we have put the pen back on the sheet. This thing is repeated 50 times to obtain concentric circles.

Recommended Posts

  • Python Turtle Programming Tutorial
  • How to draw square and rectangle in Python Turtle?
  • How to draw colour filled shapes in Python Turtle?
  • How to draw stars in Python Turtle?
  • How to depict pentagon, hexagon and other polygons in Python Turtle?
  • How to draw Olympics logo in Python Turtle?
  • How to depict a spiral square and star in Python Turtle?
  • How to describe web in Python Turtle?
  • How to describe motorcar in Python Turtle?
  • How to draw snowman in Python Turtle?
  • How to draw chessboard in Python Turtle?
  • How to describe tally marks in Python Turtle?

Source: https://www.tutorialsandyou.com/python/how-to-draw-circle-in-python-turtle-7.html

Posted by: nivensonst1959.blogspot.com

0 Response to "how to draw a circle in python 3"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel