Funkcja 3A

from tkinter import *
import math
okno = Tk()
okno.title("Funkcje")
w=900
h=500
plotno = Canvas(okno, height=h, width=w, background='white')
plotno.grid(row=0,column=0)
skala = 50

def p(x,y):
    y *= skala
    x *= skala
    x += w/2
    y = h/2 - y
    return x, y

def Rysuj(f, kolor):
    for x in range(int(-w / 2), int(w / 2)):
        plotno.create_line(p(x/skala, f(x/skala)),
                           p((x + 1)/skala, f((x + 1)/skala)),
                           fill=kolor)

def f1(x):
    return math.sin(x)

def f2(x):
    return math.cos(x)

def f3(x):
    return math.pow(x,2)-1

for x in range(int(-w / 2), int(w / 2)):
    plotno.create_line(p(x,-h/2),p(x,h/2),fill="light gray")
for y in range(int(-h / 2), int(h / 2)):
    plotno.create_line(p(-w/2,y),p(w/2,y),fill="light gray")
plotno.create_line(0, h/2, w, h/2)
plotno.create_line(w/2, 0, w/2, h)

Rysuj(f1,"red")
Rysuj(f2,"blue")
Rysuj(f3,"green")

okno.mainloop()