@ממענדל תודה על המדריך!
אני כבר הרבה זמן נהנה עם הספרייה הזאת.
משתף תוכנית שכתבתי:
import turtle
import math as m
from time import sleep
# יוצר פונקציות sin ו cos שמקבלות מעלות
def dsin(n):
return m.sin(n*m.pi/180)
def dcos(n):
return m.cos(n*m.pi/180)
screen = turtle.Screen()
t = turtle.Turtle()
def f():
t.hideturtle()
screen.tracer(0)
g = min(screen.window_width(), screen.window_height())*0.4 #מגדיר את גודל הכדור
dist = 3 #מגדיר את המרחק בין הקוים (במעלות)
st = dist/50 #מגדיר את הזמן שלוקח לצייר כל קו
t.up()
for d in range(270, 89, dist*-1):
for i in range(180):
x, y = ((dsin(i)*dsin(d)))*g, (dcos(i))*g
t.goto(x, y)
t.down()
t.up()
screen.update()
sleep(st)
t.up()
for d in range(270, 89, dist *-1):
t.up()
for i in range(180):
x, y = (dcos(i))*g, (dsin(i)*dsin(d))*g
t.goto(x, y)
t.down()
screen.update()
sleep(st)
turtle.done()
return
f()
סליחה על הקוד המבולגן, אשמח לשמוע את דעת הציבור