FT Py
FT Py
FT Py
import turtle as tt
tt.screensize(800, 800)
def fx(x):
funcfx = 0 + mt.cos(x) + mt.cos(3 * x) - mt.cos(2 * x) + 2 * mt.cos(x / 2)
return funcfx
c = 0
cs = 0
def ttset(x):
x.speed(0)
x.shape("circle")
x.turtlesize(0.1)
x.color("white")
x.pencolor("black")
x.screen.bgcolor("white")
xy = tt.Turtle()
x_axis = tt.Turtle()
y_axis = tt.Turtle()
grap = tt.Turtle()
grap2 = tt.Turtle()
ttset(xy)
ttset(x_axis)
ttset(y_axis)
ttset(grap)
ttset(grap2)
grap.pencolor("red")
grap2.pencolor("blue")
x_axis.pu()
y_axis.pu()
x_axis.goto((400, -400))
y_axis.goto((-400, 400))
x_axis.pd()
y_axis.pd()
x_axis.goto((-400, -400))
y_axis.goto((-400, -400))
x_axis.left(90)
def resettinggrap():
xy.pu()
grap.pu()
grap2.pu()
xy.goto((-400, -400))
grap.goto((-400, 0))
grap2.goto((-400, 0))
xy.pd()
grap.pd()
grap2.pd()
xy.clear()
grap.clear()
grap2.clear()
resettinggrap()
rex = []
rey = []
rerex = []
rerey = []
silhaeng(rex, rey, 0)
resettinggrap()
silhaeng(rerex, rerey, 1)
for i in range(len(rex)):
if round(abs(rey[i]), 1) >= 1 / 3:
print(rex[i], (rey[i]), "\n")
print("\n")
for i in range(len(rerex)):
if round(abs(rerey[i]), 1) >= 1 / 3:
print(rerex[i], (rerey[i]), "\n")
tt.done()