matheus__serpa icon

Untitled

matheus__serpa | PRO | 02/07/21 11:57:28 PM UTC (Edited) | 0 ⭐ | 1031 👁️ | Never ⏰ | []
Python |

300 B

|

None

|

0 👍

/

0 👎

@numba.njit
def calcula_potencial(r):
    sr6 = (1./r)**6
    pot = 4.*(sr6*sr6 - sr6)
    return pot
 
@numba.njit
def distancia(atomo1, atomo2):
    dx = atomo2[0] - atomo1[0]
    dy = atomo2[1] - atomo1[1]
    dz = atomo2[2] - atomo1[2]
 
    r = (dx * dx + dy * dy + dz * dz) ** 0.5
 
    return r

Comments