matheus__serpa

Untitled

Feb 7th, 2021 (edited)
872
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. @numba.njit
  2. def calcula_potencial(r):
  3.     sr6 = (1./r)**6
  4.     pot = 4.*(sr6*sr6 - sr6)
  5.     return pot
  6.  
  7. @numba.njit
  8. def distancia(atomo1, atomo2):
  9.     dx = atomo2[0] - atomo1[0]
  10.     dy = atomo2[1] - atomo1[1]
  11.     dz = atomo2[2] - atomo1[2]
  12.  
  13.     r = (dx * dx + dy * dy + dz * dz) ** 0.5
  14.  
  15.     return r
Advertisement
Add Comment
Please, Sign In to add comment