Skip to content

Commit

Permalink
py3 compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SHZ66 committed Jan 22, 2019
1 parent 91cc6e7 commit 1aed2fa
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions physics.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def strVec2(x):
v1 = Vector2(1, .5)
n = 5
V = initSplash(m0, M, v0, v1, n)
print V
print 'Initial momentum = ' + strVec2(m0 * (v0 - v1))
print 'Splash momentum = ' + strVec2(M/n * sumVec2(V))
print 'Initial kinetic energy = ' + str(.5 * m0 * ((v0).dot(v0) - v1.dot(v1)))
print 'Splash kinetic energy = ' + str(.5 * M/n * sumVec2sq(V))
print(V)
print('Initial momentum = ' + strVec2(m0 * (v0 - v1)))
print('Splash momentum = ' + strVec2(M/n * sumVec2(V)))
print('Initial kinetic energy = ' + str(.5 * m0 * ((v0).dot(v0) - v1.dot(v1))))
print('Splash kinetic energy = ' + str(.5 * M/n * sumVec2sq(V)))

0 comments on commit 1aed2fa

Please sign in to comment.