Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé
Classe « TNavigator » Python 3.13.2

Méthode turtle.TNavigator.circle

Signature de la méthode circle

def circle(self, radius, extent=None, steps=None) 

Description

help(TNavigator.circle)

Draw a circle with given radius.

Arguments:
radius -- a number
extent (optional) -- a number
steps (optional) -- an integer

Draw a circle with given radius. The center is radius units left
of the turtle; extent - an angle - determines which part of the
circle is drawn. If extent is not given, draw the entire circle.
If extent is not a full circle, one endpoint of the arc is the
current pen position. Draw the arc in counterclockwise direction
if radius is positive, otherwise in clockwise direction. Finally
the direction of the turtle is changed by the amount of extent.

As the circle is approximated by an inscribed regular polygon,
steps determines the number of steps to use. If not given,
it will be calculated automatically. Maybe used to draw regular
polygons.

call: circle(radius)                  # full circle
--or: circle(radius, extent)          # arc
--or: circle(radius, extent, steps)
--or: circle(radius, steps=6)         # 6-sided polygon

Example (for a Turtle instance named turtle):
>>> turtle.circle(50)
>>> turtle.circle(120, 180)  # semicircle


Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé