distance method

double distance(
  1. PositionComponent c
)

Implementation

double distance(PositionComponent c) {
  return sqrt(pow(y - c.y, 2) + pow(x - c.x, 2));
}