package org.josast.TLM;

/**
 * Calculate Cubix equation <br>
 * <i>Ax3+bx2+Cx+d </i> <br>
 * 
 * @author Christophe
 *
 */
public class CubicEqx implements ICalculData {

	double A;
	double B;
	double C;
	double D;

	/**
	 * The Constructor.
	 * 
	 * @param d the d
	 * @param a the a
	 * @param c the c
	 * @param b the b
	 */
	public CubicEqx(double a, double b, double c, double d) {
		super();
		A = a;
		B = b;
		C = c;
		D = d;
	}

	/**
	 * Calcul.
	 * 
	 * @param x the x
	 * 
	 * @return the double
	 * 
	 * 
	 */
	public double calcul(int x) {

		return A * Math.pow(x, 3) + B * Math.pow(x, 2) + C * x + D;
	}

}
