Consider the following –
If you are designing a game, and have the players shaped as circles, how would you detect bullet collisions with the players?
Well, the problem with bullet collision detection is that you can’t just use traditional collision detection algorithms with static objects. The bullet itself can be seen as a continuous object, thus we need to devise a new way to solve the problem

An example implementation in python
from math import sqrt, atan, pi
class Point(object):
def __init__(self, x = None, y = None):
self.x = x
self.y = y
class Vector(object):
def __init__(self, *args):
self.points = []
for obj in args:
if isinstance(obj, Point):
self.points.append(obj)
def dx(self):
_dx_ = self.points[0].x
for i in range(1, len(self.points)):
_dx_ -= self.points[i].x
return -_dx_
def dy(self):
_dy_ = self.points[0].y
for i in range(1, len(self.points)):
_dy_ -= self.points[i].y
return -_dy_
def dist(self):
return sqrt(self.dx()**2+self.dy()**2)
def theta(self):
try:
return atan(self.dy()/self.dx())
except ZeroDivisionError:
return 0
me = Point(0,0)
enemy = Point(1,sqrt(3))
vec = Vector(me, enemy)
a = atan(0.50/(2*vec.dist()))
print-1-+a)*360/(2*pi),-1--a)*360/(2*pi) #Theta for which you will be able to hit the enemy.