getDistance function

double getDistance(
  1. physicsObject obj1,
  2. physicsObject obj2
)

Implementation

double getDistance(physicsObject obj1, physicsObject obj2) {
  return sqrt((obj1.xPos - obj2.xPos) * (obj1.xPos - obj2.xPos) +
      (obj1.yPos - obj2.yPos) * (obj1.yPos - obj2.yPos));
}