Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from cmath import *
- D = []
- V = []
- i = complex(0.0, 1.0)
- for ball_data in eval(input()):
- diameter, mass = ball_data
- D.append(complex(diameter))
- V.append(complex(mass / 1000))
- for ind in range(len(D)):
- #v_ball = pi * D[ind] ** 3 / 6
- D = D[ind]
- V = V[ind]
- h = (D / 2) - ((1.0 - i * sqrt(3.0)) * pow(D, 2.0) * pow(pi, 1.0 / 3.0)) / (4.0 * pow(
- pow(D, 3.0) * pi - 12.0 * V + 2.0 * sqrt(6.0) * sqrt(-(pow(D, 3.0) * pi * V) + 6.0 * pow(V, 2.0)),
- 1.0 / 3.0)) - ((1.0 + i * sqrt(3.0)) * pow(
- pow(D, 3.0) * pi - 12.0 * V + 2.0 * sqrt(6.0) * sqrt(-(pow(D, 3.0) * pi * V) + 6.0 * pow(V, 2.0)),
- 1.0 / 3.0)) / (4.0 * pow(pi, 1.0 / 3.0))
- print((h.real * 1000) / 1000)
- print((h.imag * 1000) / 1000)
- print(i)
- print(pi)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement