From 692373650a3231bc023738c46cbcb8d559ca8eaf Mon Sep 17 00:00:00 2001 From: Jurandy Soares Date: Wed, 30 Oct 2024 00:08:17 +0000 Subject: [PATCH] =?UTF-8?q?F=C3=ADsica:=20lan=C3=A7amento=20obliquo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fisica/lancamento.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 fisica/lancamento.py diff --git a/fisica/lancamento.py b/fisica/lancamento.py new file mode 100644 index 0000000..d395378 --- /dev/null +++ b/fisica/lancamento.py @@ -0,0 +1,39 @@ +# Lançamento oblíquo com a biblioteca turtle de Python +import turtle + +LARG = 800 +ALT = 600 +MEIA_LARG = LARG//2 +MEIA_ALT = ALT//2 + +v0x = 10 # pixels/passo +v0y = 40 # pixels/passo + +def sx(tempo: float) -> float: + return -MEIA_LARG + v0x*tempo +# fim-def + +def sy(pos_x: float) -> float: + return -(3/800)*(pos_x**2)+300 +# fim-def + +def main(): + turtle.setup(LARG, ALT) + turtle.shape('turtle') + turtle.color('blue', 'red') + turtle.up() + turtle.goto(-MEIA_LARG, -MEIA_ALT) + turtle.down() + + for t in range(81): + x = sx(t) + y = sy(x) + turtle.goto(x, y) + # fim-for + + turtle.done() +# fim-def + +if __name__ == '__main__': + main() +# fim-if \ No newline at end of file