Skip to content

Instantly share code, notes, and snippets.

@dtbao20
Created May 8, 2024 04:01
Show Gist options
  • Save dtbao20/5e29b1c371e3a6e52a2344fdfb43e3cc to your computer and use it in GitHub Desktop.
Save dtbao20/5e29b1c371e3a6e52a2344fdfb43e3cc to your computer and use it in GitHub Desktop.
cờ giải phóng
from turtle import *
bgcolor("#f00"),setup(600,400,800,80)
hideturtle(), tracer(0), penup()
from math import sin, cos, pi
from time import perf_counter
def _30_4_1975():
update(), clear()
t = perf_counter()*3
goto(0,-9999), dot(9999*2, (0,0.5,1))
color("#ff0")
begin_fill()
for i in range(401):
a = (i/400)*4*pi
R = 50/cos(a%(pi*4/5)-pi*4/5/2)
goto(R*cos(a+pi/2)+2*cos(t+R), R*sin(a+pi/2)+2*sin(t+R))
end_fill()
ontimer(_30_4_1975, 10)
_30_4_1975()
mainloop()
# Ps: chỉ chạy đúng trên các phiên bản Python 3.11 trở xuống
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment