From 94ec166a4a6bead82ad25bee1ea38d35bf563d52 Mon Sep 17 00:00:00 2001 From: Antonio Carzaniga Date: Fri, 10 Jun 2022 12:47:03 +0200 Subject: [PATCH] fix variable renaming in ball_elastic_collision. --- balls.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/balls.cc b/balls.cc index 6a862f4..a4d91ff 100644 --- a/balls.cc +++ b/balls.cc @@ -99,8 +99,8 @@ void ball_elastic_collision (ball * p, ball * q) { if (f < 0) { f /= d2*(mp + mq); - p->velocity += 2*mq*f*dp; - q->velocity -= 2*mp*f*dp; + p->velocity += 2*mq*f*pq; + q->velocity -= 2*mp*f*pq; } } }