Skip to content

Commit

Permalink
Use new API
Browse files Browse the repository at this point in the history
  • Loading branch information
ekiefl committed Jan 8, 2025
1 parent 315b949 commit 1ed32fb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/examples/30_degree_rule.pct.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,8 @@ def get_carom_angle(system: pt.System) -> float:
pt.events.by_type(pt.EventType.SLIDING_ROLLING),
)[0]

velocity_final = transition.agents[0].final.state.rvw[1, :2]
for agent in collision.agents:
if agent.id == "cue":
velocity_initial = agent.initial.state.rvw[1, :2]
velocity_final = transition.get_ball("cue", initial=False).state.rvw[1, :2]
velocity_initial = transition.get_ball("cue", initial=True).state.rvw[1, :2]

return pt.ptmath.utils.angle_between_vectors(velocity_final, velocity_initial)

Expand Down

0 comments on commit 1ed32fb

Please sign in to comment.