Class Quadratic
java.lang.Object
|
+--Quadratic
- class Quadratic
- extends java.lang.Object
- implements Function
Represents a simplified quadratic curve. The function will have a
repeated root (on the origin by default).
|
Constructor Summary |
Quadratic()
Creates a new quadratic curve, with a single root on the origin, and
passing through (-1,1) and (1,1). |
Quadratic(double coeff)
Creates a new quadratic curve, with a single root on the origin. |
Quadratic(double coeff,
double shift)
Creates a new quadratic curve. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
coeff
protected double coeff
shift
protected double shift
DEFAULT_COEFF
public static final double DEFAULT_COEFF
DEFAULT_SHIFT
public static final double DEFAULT_SHIFT
Quadratic
public Quadratic(double coeff,
double shift)
- Creates a new quadratic curve.
- Parameters:
coeff - The x-squared coefficientshift - The x-coordinate of the root
Quadratic
public Quadratic(double coeff)
- Creates a new quadratic curve, with a single root on the origin.
- Parameters:
coeff - The x-squared coefficient
Quadratic
public Quadratic()
- Creates a new quadratic curve, with a single root on the origin, and
passing through (-1,1) and (1,1).
evaluate
public double evaluate(double x)
- Specified by:
- evaluate in interface Function
- Returns:
- coeff*(x-shift)*(x-shift)
getShift
public double getShift()
getCoeff
public double getCoeff()
setShift
public void setShift(double d)
setCoeff
public void setCoeff(double d)