Last active
January 23, 2020 23:55
-
-
Save rogersguedes/4d314625c6490d8f03d606e996ebef0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/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