Clarify variable name
This commit is contained in:
parent
86d5ca98bf
commit
4a31fc1a7d
1 changed files with 3 additions and 3 deletions
|
@ -47,10 +47,10 @@ def n_body_matrix_constrained(pos: np.ndarray, vel: np.ndarray, mass: np.ndarray
|
||||||
dist[i - 1] = pos2[i: i + len(pos)] - pos
|
dist[i - 1] = pos2[i: i + len(pos)] - pos
|
||||||
rot_mass[i - 1] = mass2[i: i + len(mass)]
|
rot_mass[i - 1] = mass2[i: i + len(mass)]
|
||||||
|
|
||||||
a = np.linalg.norm(dist, axis=2)
|
norms = np.linalg.norm(dist, axis=2)
|
||||||
a[a < close] = close
|
norms[norms < close] = close
|
||||||
vel += G * np.sum(
|
vel += G * np.sum(
|
||||||
dist * rot_mass / (a ** 3)[:, :, np.newaxis],
|
dist * rot_mass / (norms ** 3)[:, :, np.newaxis],
|
||||||
axis=0
|
axis=0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue