jasext.hist.function
Class LorentzianFunction
java.lang.Object
|
+--java.util.Observable
|
+--jas.hist.Basic1DFunction
|
+--jas.hist.Fittable1DFunction
|
+--jasext.hist.function.LorentzianFunction
- All Implemented Interfaces:
- DataSource, ExtendedStatistics, FunctionData, HasHandles, HasStatistics, java.io.Serializable, Statistics
- public class LorentzianFunction
- extends Fittable1DFunction
- implements HasHandles
Fittable Lorentzian function with handles:
y(x) = A*(g/2)^2/((x-x0)^2+(g/2)^2)
A = maximum value of the function
x0 = origin, corresponding to the maximum value of y(x)
g = width
Also known as a Breit-Wigner distribution in nuclear physics.
The initial function shape will be based on the current maximum
and minimum axis values (not the data).
Handles:
There are three handles.
Handle 1: Changes the function amplitude and origin. The handle position
corresponds to the current amplitude and origin values.
Handles 2,3: Change the function width. The handle y position is the function
value at half amplitude. The x position is offset from the
function origin by +/- the half width.
- See Also:
- Serialized Form
Constructor Summary |
LorentzianFunction(double xmin,
double xmax,
double ymin,
double ymax)
|
Methods inherited from class jas.hist.Fittable1DFunction |
clearFit, clearFitParams, destroy, getDerivatives, getExtendedStatistic, getFit, getIncludeParametersInFit, getStatistic, getStatisticNames, initIncludeParametersInFit, setFit, setIncludeParameterInFit |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LorentzianFunction
public LorentzianFunction(double xmin,
double xmax,
double ymin,
double ymax)
valueAt
public double valueAt(double x)
- Overrides:
valueAt
in class Basic1DFunction
valueAt
public double valueAt(double x,
double[] a)
- Overrides:
valueAt
in class Fittable1DFunction
getParameterNames
public java.lang.String[] getParameterNames()
- Overrides:
getParameterNames
in class Basic1DFunction
getParameterValues
public double[] getParameterValues()
- Overrides:
getParameterValues
in class Basic1DFunction
setParameter
public void setParameter(int index,
double value)
- Overrides:
setParameter
in class Basic1DFunction
setFit
public void setFit(Fitter fit,
double[] value)
- Overrides:
setFit
in class Fittable1DFunction
getTitle
public java.lang.String getTitle()
- Overrides:
getTitle
in class Basic1DFunction
getHandles
public Handle[] getHandles(double xLow,
double xHigh,
double yLow,
double yHigh)
- Specified by:
getHandles
in interface HasHandles