Class HarmonicFunction
java.lang.Object
org.apache.commons.math.optimization.fitting.HarmonicFunction
- All Implemented Interfaces:
DifferentiableUnivariateRealFunction
,UnivariateRealFunction
Harmonic function of the form
f (t) = a cos (ω t + φ)
.- Since:
- 2.0
-
Constructor Details
-
HarmonicFunction
public HarmonicFunction(double a, double omega, double phi) Simple constructor.- Parameters:
a
- amplitudeomega
- pulsationphi
- phase
-
-
Method Details
-
value
public double value(double x) Compute the value for the function.- Specified by:
value
in interfaceUnivariateRealFunction
- Parameters:
x
- the point for which the function value should be computed- Returns:
- the value
-
derivative
Returns the derivative of the function- Specified by:
derivative
in interfaceDifferentiableUnivariateRealFunction
- Returns:
- the derivative function
-
getAmplitude
public double getAmplitude()Get the amplitude a.- Returns:
- amplitude a;
-
getPulsation
public double getPulsation()Get the pulsation ω.- Returns:
- pulsation ω
-
getPhase
public double getPhase()Get the phase φ.- Returns:
- phase φ
-