illusion5.py

Created by schraf

Created on August 15, 2022

346 Bytes

Illusion de Orbison : Le carré rouge parait déformé et ressemble à un losange, or il a bien 4 angles droits !

🖥 Visiter ma chaine Youtube Maths-info

M’offrir un café


from turtle import *

pensize(3)
hideturtle()
speed(0)

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

# Lignes bleues
color((15,160,240))
for i in range(12):
  y = -11 - 22 * i
  go(-160, y)
  goto(-138 + 52 * i, 0)
  goto(-160, -y)

# Carre rouge
color((255,10,0))
go(5,78)
setheading(-45)
for _ in range(4):
  fd(110); rt(90)

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 cookies policy.