/* ----------------------------------------
 * Origin  : GFI INFORMATIQUE 
 * Project : CDPP Propagation Tool 
 * ----------------------------------------
 * History 
 * Version : 05/05/2022 : LBE : V2.5
 * DM-ID : Redmine#9229 : 01/05/2022 : PFSS mode
 * Version : 05/08/2024 : LBE : V2.11
 * DM-ID : Redmine#l0763 : 05/08/2024 : aded length()
 * VERSION : V2.12
 * DM-ID : redmine#11799 : 08/04/2025 : KHK : PFSS mode – Br Factor
 * ----------------------------------------
 */
package fr.tlse.irap.fieldLine;

import java.io.Serializable;

public class FieldPoint implements Serializable {

	private static final long serialVersionUID = 1L;

        //position
	private double x = Double.NaN;//in km
	private double y = Double.NaN;
	private double z = Double.NaN;
        //field value
	private double bx = Double.NaN;
	private double by = Double.NaN;
	private double bz = Double.NaN;

	public FieldPoint() {
		super();
	}

	public FieldPoint(double x, double y, double z,double bx, double by, double bz) {
		this.x = x;
		this.y = y;
		this.z = z;
		this.bx = bx;
		this.by = by;
		this.bz = bz;
	}

    /**
     * @return the x
     */
    public double getX() {
        return x;
    }

    /**
     * @param x the x to set
     */
    public void setX(double x) {
        this.x = x;
    }

    /**
     * @return the y
     */
    public double getY() {
        return y;
    }

    /**
     * @param y the y to set
     */
    public void setY(double y) {
        this.y = y;
    }

    /**
     * @return the z
     */
    public double getZ() {
        return z;
    }

    /**
     * @param z the z to set
     */
    public void setZ(double z) {
        this.z = z;
    }

    /**
     * @return the bx
     */
    public double getBx() {
        return bx;
    }

    /**
     * @param bx the bx to set
     */
    public void setBx(double bx) {
        this.bx = bx;
    }

    /**
     * @return the by
     */
    public double getBy() {
        return by;
    }

    /**
     * @param by the by to set
     */
    public void setBy(double by) {
        this.by = by;
    }

    /**
     * @return the bz
     */
    public double getBz() {
        return bz;
    }

    /**
     * @param bz the bz to set
     */
    public void setBz(double bz) {
        this.bz = bz;
    }
    /**
     * Get vector length.
     * @return Length
     */
    public double length() {
        return Math.sqrt(x*x+y*y+z*z);
    }
    /**
     * Get field value length - Br factor .
     *
     * @return Br factor
     */
    public double Br() {
        return Math.sqrt(bx * bx + by * by + bz * bz);
    }
    
}
