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
ConstructorDescriptionCosineWave
(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 TypeMethodDescriptiondouble
fX
(double x) Evaluates the function at x.double
integralAt
(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 ofinvalid reference
double
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 ofinvalid reference
double
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:
fX
in classFunctionDataCurve
- Parameters:
x
- x- Returns:
- f(x)
-
integralAt
public double integralAt(double x) Analytical integral at a point.- Specified by:
integralAt
in classFunctionDataCurve
- Parameters:
x
- Point- Returns:
- Exact finite integral of 0 to this point
-
toString
- Overrides:
toString
in classFunctionDataCurve
-