# Circle velocities stay the same after elastic 2D collision

I am following this paper in trying to create elastic 2D collisions among two circles. The problem is that my end velocities are the same as my start velocities. I've looked over my code and don't see anything off.

This is what I am hoping to achieve: Maybe a second pair of eyes will notice something obviously wrong:

function resolveCircleCollision(playerOne, playerTwo) {

var xDiff = playerTwo.objectData.pos.x - playerOne.objectData.pos.x;
var yDiff = playerTwo.objectData.pos.y - playerOne.objectData.pos.y;
var normalVector = new Vector(xDiff, yDiff);

// Normal/tangent unit vectors
var normalUnitVector = normalVector.normalized();
var tangentUnitVector = new Vector(-1 * normalUnitVector.y,     normalUnitVector.x);

// Resolve velocity vectors into normal/tangential components
var playerOneNormalComponent = normalUnitVector.dot(playerOne.velocity);
var playerOneTangentComponent = tangentUnitVector.dot(playerOne.velocity); // Same post collision
var playerTwoNormalComponent = normalUnitVector.dot(playerTwo.velocity);
var playerTwoTangentComponent = tangentUnitVector.dot(playerTwo.velocity); // Same post collision

// Find normal components post collision
var playerOneNormalComponentPrime = (playerOneNormalComponent * (playerOne.mass - playerTwo.mass) + (2 * playerTwo.mass * playerTwoNormalComponent)) / (playerOne.mass + playerTwo.mass);
var playerTwoNormalComponentPrime = (playerTwoNormalComponent * (playerTwo.mass - playerOne.mass) + (2 * playerOne.mass * playerOneNormalComponent)) / (playerOne.mass + playerTwo.mass);

// Convert the components into vectors
var playerOneNormalVector = normalUnitVector.multiply(playerOneNormalComponentPrime);
var playerOneTangentVector = tangentUnitVector.multiply(playerOneTangentComponent);
var playerTwoNormalVector = normalUnitVector.multiply(playerTwoNormalComponentPrime);
var playerTwoTangentVector = tangentUnitVector.multiply(playerTwoTangentComponent);

// Add the two components and set them equal to the player velocities

• playerOne.velocity pre-collision == playerOne.velocity post-collision and playerTwo.velocity pre-collision == playerTwo.velocity post-collision Hope that clears it up. – Moother Dec 26 '15 at 5:13