Adição de gráfico de equação do 2º grau
This commit is contained in:
parent
2f6fb3cff8
commit
cf3896075c
|
@ -0,0 +1,21 @@
|
||||||
|
import turtle
|
||||||
|
|
||||||
|
LARG = 800
|
||||||
|
ALT = 600
|
||||||
|
|
||||||
|
turtle.setup(LARG, ALT)
|
||||||
|
|
||||||
|
def f(x: int) -> int:
|
||||||
|
return -(3/800)*(x**2)+300
|
||||||
|
|
||||||
|
turtle.up()
|
||||||
|
ini_x = -LARG//2
|
||||||
|
ini_y = f(ini_x)
|
||||||
|
turtle.goto(ini_x, round(ini_y))
|
||||||
|
turtle.down()
|
||||||
|
|
||||||
|
for x in range(1-LARG//2, -1+LARG//2):
|
||||||
|
y = f(x)
|
||||||
|
turtle.goto(x, round(y))
|
||||||
|
|
||||||
|
turtle.done()
|
Loading…
Reference in New Issue