Update matematica/eq2grau.py

This commit is contained in:
Jurandy Soares 2024-10-30 00:18:04 +00:00
parent 692373650a
commit a4e087d482
1 changed files with 17 additions and 11 deletions

View File

@ -3,19 +3,25 @@ import turtle
LARG = 800
ALT = 600
turtle.setup(LARG, ALT)
def f(x: int) -> int:
return -(3/800)*(x**2)+300
# fim-def
turtle.up()
ini_x = -LARG//2
ini_y = f(ini_x)
turtle.goto(ini_x, round(ini_y))
turtle.down()
def main():
turtle.setup(LARG, ALT)
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):
for x in range(1-LARG//2, -1+LARG//2):
y = f(x)
turtle.goto(x, round(y))
# fim-for
turtle.done()
turtle.done()
# fim-def
if __name__ == '__main__':
main()