mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-04 16:57:32 +08:00
The black formatter is no longer beta (#5960)
* The black formatter is no longer beta * pre-commit autoupdate * pre-commit autoupdate * Remove project_euler/problem_145 which is killing our CI tests * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -159,16 +159,16 @@ class BodySystem:
|
||||
|
||||
# Calculation of the distance using Pythagoras's theorem
|
||||
# Extra factor due to the softening technique
|
||||
distance = (dif_x ** 2 + dif_y ** 2 + self.softening_factor) ** (
|
||||
distance = (dif_x**2 + dif_y**2 + self.softening_factor) ** (
|
||||
1 / 2
|
||||
)
|
||||
|
||||
# Newton's law of universal gravitation.
|
||||
force_x += (
|
||||
self.gravitation_constant * body2.mass * dif_x / distance ** 3
|
||||
self.gravitation_constant * body2.mass * dif_x / distance**3
|
||||
)
|
||||
force_y += (
|
||||
self.gravitation_constant * body2.mass * dif_y / distance ** 3
|
||||
self.gravitation_constant * body2.mass * dif_y / distance**3
|
||||
)
|
||||
|
||||
# Update the body's velocity once all the force components have been added
|
||||
|
Reference in New Issue
Block a user