Skip to content

Instantly share code, notes, and snippets.

View PedroBern's full-sized avatar

pedrobern PedroBern

View GitHub Profile
@PedroBern
PedroBern / fundacoes.py
Last active September 14, 2019 20:47
Fundacoes
import math
import numpy as np
import scipy.optimize as optimize
import matplotlib.pyplot as plt
import sys
from tabulate import tabulate
def _round(n):
if n - math.floor(n) < 0.5:
from trianglesolver import solve
import numpy as np
# a, b, c são os lados dos triangulos
# A, B, C são os angulos dos triangulos, sempre opostos ao lado de mesma letra
a, b, c, A, B, C = solve(a=11.4, B=np.deg2rad(60), C=np.deg2rad(110))
print('Distancia margem do rio (metros):', b)
a, b, c, A, B, C = solve(a=46.4, b=3.9-0.4, C=np.pi/2)
import numpy as np
from collections import namedtuple
import matplotlib.pyplot as plt
# Dados do problema:
gama_a = 20
gama_n = 23
h = 12
sup_base = 10
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
# Dados do problema
gama = 19
m = 0.5
k = 0.5
import numpy as np
matrix01 = np.matrix([
[3, -0.1, -0.2],
[0.1, 7, -0.3],
[0.3, -0.2, 10],
])
solution01 = np.matrix([
[7.85, -19.3, 71.4]
@PedroBern
PedroBern / keymap.cson
Created March 24, 2019 14:52
My atom keymap for mac
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@PedroBern
PedroBern / trabalho_topografia.py
Created March 24, 2019 14:12
Cálculo da área de polígono desenhado por azimutes e distancia
import turtle as tu
import numpy as np
screen = tu.Screen()
points = [[10,240],[269,330],[170,410],[110,230],[0,260]]
t = tu.Turtle()
t.speed('fastest')
c = tu.Turtle()