Adição de gráfico de equação do 2º grau

This commit is contained in:
Jurandy Soares 2024-10-29 19:09:38 +00:00
parent 2f6fb3cff8
commit cf3896075c
1 changed files with 21 additions and 0 deletions

21
matematica/eq2grau.py Normal file
View File

@ -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()