public class Point3D extends Point {
    private double z;
    public Point3D(double x, double y, double z) {
        super(x, y);
        this.z = z;
    }
    public double getZ() {
        return this.z;
    }
    @Override
    public double distanceToZero() {
        return Math.sqrt(
                Math.pow(this.x, 2) +
                Math.pow(this.y, 2) +
                Math.pow(this.z, 2));
    }
    // No es @Override porque es distance(Point3D) y no distance(Point)
    public double distance(Point3D other) {
        return Math.sqrt(
                Math.pow(this.x-other.x, 2) +
                Math.pow(this.y-other.y, 2) +
                Math.pow(this.z-other.z, 2));
    }
    @Override
    public double squaredDistanceToZero() {
        return  super.squaredDistanceToZero() +
                Math.pow(this.z, 2);
    }
    @Override
    public String toString() {
        // return super.toString() + "," + this.z;
        return  "(" + this.x + "," + this.y + "," + this.z + ")";
        // this.x i super.x son lo mismo.
    }
}
