Package ffx.numerics.integrate
Class CosineWave
java.lang.Object
ffx.numerics.integrate.FunctionDataCurve
ffx.numerics.integrate.CosineWave
- All Implemented Interfaces:
DataSet
A CosineWave describes points along a sine wave of f(x) = a*sin(jx).
- Author:
- Jacob M. Litman
-
Field Summary
Fields inherited from class ffx.numerics.integrate.FunctionDataCurve
halfWidthEnd, lb, points, ub, x -
Constructor Summary
ConstructorsConstructorDescriptionCosineWave(double[] x, boolean halfWidthEnds, double a, double n) Constructs f(x) = a*cos(nx).CosineWave(double[] x, double a, double n) Constructs f(x) = a*cos(nx). -
Method Summary
Modifier and TypeMethodDescriptiondoublefX(double x) Evaluates the function at x.doubleintegralAt(double x) Analytical integral at a point.toString()Methods inherited from class ffx.numerics.integrate.FunctionDataCurve
analyticalIntegral, analyticalIntegral, approxEquals, approxEquals, assertXIntegrity, binWidth, getAllFxPoints, getFxPoint, getX, halfWidthEnds, lowerBound, numPoints, upperBound
-
Constructor Details
-
CosineWave
public CosineWave(double[] x, double a, double n) Constructs f(x) = a*cos(nx).- Parameters:
x- an array of double values.a- the magnitude.n- the periodicity.
-
CosineWave
public CosineWave(double[] x, boolean halfWidthEnds, double a, double n) Constructs f(x) = a*cos(nx).- Parameters:
x- an array of double values.halfWidthEnds- Use half-width start and end bins.a- the magnitude.n- the periodicity.
-
-
Method Details
-
fX
public double fX(double x) Evaluates the function at x.- Specified by:
fXin classFunctionDataCurve- Parameters:
x- x- Returns:
- f(x)
-
integralAt
public double integralAt(double x) Analytical integral at a point.- Specified by:
integralAtin classFunctionDataCurve- Parameters:
x- Point- Returns:
- Exact finite integral of 0 to this point
-
toString
- Overrides:
toStringin classFunctionDataCurve
-