Skip to content

Instantly share code, notes, and snippets.

@joshuachris2001
Created February 23, 2025 23:56
Show Gist options
  • Save joshuachris2001/5fa9aff81c1897466af16dd69c98a6e8 to your computer and use it in GitHub Desktop.
Save joshuachris2001/5fa9aff81c1897466af16dd69c98a6e8 to your computer and use it in GitHub Desktop.
Trigon-wheel
from math import*
from turtle import*
speed(10)
hideturtle()
width(2)
up()
goto(0,-90)
down()
circle(90)
liste_angl=(0,30,45,60,90,120,135,150,180,210,225,240,270,300,315,330)
liste_str=("0 2π","π/6","π/4","π/3","π/2","2π/3","3π/4","5π/6","π -π","7π/6","5π/4","4π/3","3π/2","5π/3","7π/4","11π/6")
x=0
width(1)
color("grey")
down()
while x<=15:
goto(0,0)
setheading(liste_angl[x])
forward(90)
x=x+1
y=0
x=0
color("black")
up()
while x<=4:
y=-2
goto(0,0)
setheading(liste_angl[x])
forward(90+y)
write((liste_str[x]))
x=x+1
while 4<x<8:
y=17
goto(0,0)
setheading(liste_angl[x]+12)
forward(90+y)
write((liste_str[x]))
x=x+1
while 8<=x<=12:
y=23
goto(0,0)
setheading(liste_angl[x])
if x==8:
y=y+13
forward(90+y)
write((liste_str[x]))
x=x+1
while 12<x<=15:
y=14
goto(0,0)
setheading(liste_angl[x])
forward(90+y)
write((liste_str[x]))
x=x+1
up()
goto(0,0)
down()
write("0")
up()
goto(22,42)
down()
write("x")
up()
goto(22,-42)
down()
write("-x")
up()
goto(-42,42)
down()
write("x-π")
up()
goto(-42,-42)
down()
write("π-x")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment