public class Point {
    protected double x;
    protected double y;
    // Si no fueran protected Point3D deberia
    // acceder a ellas a traves de los getters.
    public Point(double x, double y) {
        this.x = x;
        this.y = y;
    }
    public double getX() {
        return this.x;
    }
    public double getY() {
        return this.y;
    }
    public double distanceToZero() {
        return Math.sqrt(
                Math.pow(this.x, 2) +
                Math.pow(this.y, 2));
    }
    public double distance(Point other) {
        return Math.sqrt(
                Math.pow(this.x-other.x, 2) +
                Math.pow(this.y-other.y, 2));
    }
    // Square distance sirve para comparar distancias
    public double squaredDistanceToZero() {
        return  Math.pow(this.x, 2) +
                Math.pow(this.y, 2);
    }
    @Override
    public String toString() {
        // return this.x + "," + this.y;
        return  "(" + this.x + "," + this.y + ")";
    }
}
