distanceToSquared(v) {
    const dx = this.x - v.x;
    const dy = this.y - v.y;

    return dx * dx + dy * dy;
  }
Calculates the squared distance to another vector.
@param {Vector2D} v - The other vector.
@returns {number} The squared distance.