coquillage.py

Created by schraf

Created on August 14, 2021

452 Bytes


from turtle import *
from math import pi,sqrt

pas = 360
r = 180
# nb d'or
phi = (1 + sqrt(5)) / 2
pensize(2)
speed(6)

penup()
goto(-145,-90)
pendown()

for t in range(8):
  setheading(90 - 90 * t)
  # dessin de l'arc
  for _ in range(pas):
    right(90 / pas)
    forward(r * pi / 2 / pas)
  right(90)
  # dessin du carre
  for _ in range(4):
    forward(r)   
    right(90)
  # rayon pr etape suivante
  r *= phi - 1 

hideturtle()

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.