Skip to content

Commit

Permalink
Apply change in 2cd35e2
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiefl committed Jan 4, 2025
1 parent 2e77291 commit f052869
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pooltool/physics/resolve/ball_ball/friction.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ class AlciatoreBallBallFriction:

def calculate_friction(self, ball1: Ball, ball2: Ball) -> float:
unit_x = np.array([1.0, 0.0, 0.0])
v1_c = ptmath.surface_velocity(ball1.state.rvw, unit_x, ball1.params.R)
v2_c = ptmath.surface_velocity(ball2.state.rvw, -unit_x, ball2.params.R)
v1_c = ptmath.surface_velocity(
ball1.state.rvw, unit_x, ball1.params.R
) - np.array([ball1.state.rvw[1][0], 0, 0])
v2_c = ptmath.surface_velocity(
ball2.state.rvw, -unit_x, ball2.params.R
) - np.array([ball2.state.rvw[1][0], 0, 0])
relative_surface_speed = ptmath.norm3d(v1_c - v2_c)
return self.a + self.b * math.exp(-self.c * relative_surface_speed)

Expand Down

0 comments on commit f052869

Please sign in to comment.