Skip to content

Instantly share code, notes, and snippets.

@rogersguedes
Last active January 23, 2020 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogersguedes/4d314625c6490d8f03d606e996ebef0a to your computer and use it in GitHub Desktop.
Save rogersguedes/4d314625c6490d8f03d606e996ebef0a to your computer and use it in GitHub Desktop.
#/usr/bin/python
import math
r = 47.5
h = 23.75 # 47.5 #95.0
L = 150.0
if h > 2*r:
print "'h' nao pode ser maior que 'r'"
exit()
A_t = math.pi * math.pow(r, 2)
V_t = A_t * L
print "Area total: ", A_t
print "Volume total: ", V_t
A_1 = (math.pi * math.pow(r, 2) / 2)
A_2 = math.pow(r, 2) * math.asin( (r-h)/r )
A_3 = (h-r) * math.sqrt( math.pow(r, 2) - math.pow((h-r), 2) )
A = A_1 - A_2 + A_3
v = A * L
print "Raio", r
print "Altura", h
print "Comprimento", L
print "Area", A
print "Volume: ", v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment