.getRadius());
Side sides[] = { Side.BOTTOM, Side.RIGHT, Side.TOP, Side.LEFT, Side.CORNER,
Side.CORNER, Side.CORNER, Side.CORNER };
Ray2D ballMovementRay = ball.getMovementRay();
SpeedVector2D ballSpeed = ball.getSpeed();
Coordinates2D pointOfIntersection;
for (LineSegment2D brickLineSegment : brickLineSegments)
{
try
{
pointOfIntersection = brickLineSegment.intersectionPoint(ballMovementRay);
double distance = Math.sqrt(Math.pow(
pointOfIntersection.getX() - ball.getX(), 2)
+ Math.pow(pointOfIntersection.getY() - ball.getY(), 2));
long timeTillCollision = (long) (distance / ballSpeed.getSpeedValue());
Side side = sides[brickLineSegments.indexOf(brickLineSegment)];
collisionList.add(new BallWithBrickCollision(timeTillCollision, this, side));
} catch (DoesnotIntersectException e)
{