CoCalc Public FilesFisica-Geral / Dinamica-Leis-Newton.ipynb
Author: João Marcello Pereira
Views : 183
Description: Física dinâmica vetores Leis de Newton
Compute Environment: Ubuntu 20.04 (Default)

# Dinamica

## Leis de Newton

### Vetor Força

In [1]:
from sage.repl.ipython_kernel.interact import interact
@interact
def plot_a_function(x1 = (-5, 5), y1 = (-5, 5), x2 = (-5, 5), y2 = (-5, 5)):
F1 = vector([x1, y1])
F2 = vector([x2, y2])
Fr = F1 + F2

V = plot(F1, xmin = -10, xmax = 10, ymin = -10, ymax = 10, gridlines = 'minor', gridlinesstyle=dict(alpha = 0.4), axes_labels = ['x', 'y']) + \
line([(x1, 0), (x1, y1)], linestyle = '--', alpha = 0.5)  + \
line([(0, y1), (x1, y1)], linestyle = '--', alpha = 0.5)  + \
\
plot(F2, color = 'green' ) + \
line([(x2, 0), (x2, y2)], linestyle = '--', color = 'green', alpha = 0.5) + \
line([(0, y2), (x2, y2)], linestyle = '--', color = 'green', alpha = 0.5) + \
\
plot(F1 + F2, color = 'red') +\
line([(x1 + x2, 0), (x1 + x2, y1 + y2)], linestyle = '--', color = 'red', alpha = 0.5) + \
line([(0, y1 + y2), (x1 + x2, y1 + y2)], linestyle = '--', color = 'red', alpha = 0.5) + \
\
scatter_plot([(0,0)])

show(V)
show('Módulo vetores')
show('F1(azul) = ', F1.norm().n(), 'N', ' --------', ' F2(verde) = ', F2.norm().n(), 'N' ,' --------','  Fr(vermelho) = ', Fr.norm().n(), 'N')

In [ ]: