From cf3896075cecdaeda5812bf9413437e9f3b2528a Mon Sep 17 00:00:00 2001 From: Jurandy Soares Date: Tue, 29 Oct 2024 19:09:38 +0000 Subject: [PATCH] =?UTF-8?q?Adi=C3=A7=C3=A3o=20de=20gr=C3=A1fico=20de=20equ?= =?UTF-8?q?a=C3=A7=C3=A3o=20do=202=C2=BA=20grau?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- matematica/eq2grau.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 matematica/eq2grau.py diff --git a/matematica/eq2grau.py b/matematica/eq2grau.py new file mode 100644 index 0000000..a498213 --- /dev/null +++ b/matematica/eq2grau.py @@ -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()