package Bubulle;

public class Bulle {
	
	private int no;
	private double x, y, z;
	
	public Bulle(int no, String x, String y, String z) {
		this.no = no;
		this.x = Double.parseDouble(x);
		this.y = Double.parseDouble(y);
		this.z = Double.parseDouble(z);
	}
	
	public Bulle(int no, double x, double y, double z) {
		this.no = no;
		this.x = x;
		this.y = y;
		this.z = z;
	}
	
	public Bulle(int no, String[] tab) {
		this.no = no;
		this.x = Double.parseDouble(tab[0]);
		this.y = Double.parseDouble(tab[1]);
		this.z = Double.parseDouble(tab[2]);
	}

	public int getNo() {
		return no;
	}

	public void setNo(int no) {
		this.no = no;
	}

	public double getX() {
		return x;
	}

	public void setX(double x) {
		this.x = x;
	}

	public double getY() {
		return y;
	}

	public void setY(double y) {
		this.y = y;
	}

	public double getZ() {
		return z;
	}

	public void setZ(double z) {
		this.z = z;
	}

        //calcul la distance entre 2 bulles
        public double distanceXYZ(Bulle b){
            return Math.sqrt(Math.pow(this.getX()-b.getX(),2) + Math.pow(this.getY()-b.getY(),2) + Math.pow(this.getZ()-b.getZ(),2));
        }

}
