Ball – Ball Collision

Below is a python code written in codeskulptor to test the reflection of a ball when it collides with another ball. Different values can be given to v and v1 to test it if is working in the manner we want to.

from math import *
v = [1, 0]
v1= [0, 0]
angle = pi/4

def update_collision(v,angle):
return v1

print update_collision(v)