Package org.opensourcephysics.display
Class UncertainFunctionDrawer
java.lang.Object
org.opensourcephysics.display.FunctionDrawer
org.opensourcephysics.display.UncertainFunctionDrawer
- All Implemented Interfaces:
Drawable,Measurable,Function
When uncertain and unfilled, UncertainFunctionDrawer draws a KnownFunction
with upper and lower limits based on specified parameter uncertainties.
When not uncertain, behaves exactly like FunctionDrawer.
The function is evaluated at every screen pixel.
- Version:
- 1.0
- Author:
- Doug Brown
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AlphaCompositeprotected KnownFunctionprotected GeneralPathprotected double[]protected double[]protected booleanprotected double[][]protected double[]protected GeneralPathFields inherited from class org.opensourcephysics.display.FunctionDrawer
color, enabled, filled, function, functionChanged, generalPath, measured, numpts, xrange, yrange -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an UncertainFunctionDrawer. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckRange(DrawingPanel panel) voidSets all uncertainties to zero.voiddraw(DrawingPanel panel, Graphics g) Draws the function on a drawing panel.double[]evaluateMinMax(double x, double[] results) Evaluates the function and determines min/max values by evaluating the function with uncertainParameter sets.voidsetUncertain(boolean uncertain) Sets the uncertain property.voidsetUncertainties(double[][] sigmasAndParams) Sets the uncertainties of all parameters.Methods inherited from class org.opensourcephysics.display.FunctionDrawer
evaluate, getPath, getXMax, getXMin, getXRange, getYMax, getYMin, getYRange, initialize, isMeasured, setColor, setEnabled, setFilledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensourcephysics.display.Drawable
isInteractive
-
Field Details
-
upperPath
-
lowerPath
-
knownFunction
-
uncertain
protected boolean uncertain -
uncertainties
protected double[] uncertainties -
paramValues
protected double[] paramValues -
uncertainParams
protected double[][] uncertainParams -
multiplier
protected double[] multiplier -
composite
-
-
Constructor Details
-
UncertainFunctionDrawer
Constructs an UncertainFunctionDrawer.- Parameters:
f- the KnownFunction to draw.
-
-
Method Details
-
evaluateMinMax
public double[] evaluateMinMax(double x, double[] results) Evaluates the function and determines min/max values by evaluating the function with uncertainParameter sets.- Parameters:
x-results- double[3] {min, value, max}, may be null- Returns:
- results
-
checkRange
- Overrides:
checkRangein classFunctionDrawer
-
setUncertain
public void setUncertain(boolean uncertain) Sets the uncertain property.- Parameters:
uncertain- true to show non-zero uncertainties
-
setUncertainties
public void setUncertainties(double[][] sigmasAndParams) Sets the uncertainties of all parameters.- Parameters:
sigmasAndParams- array of uncertainties and uncertain limit parameters
-
clearUncertainties
public void clearUncertainties()Sets all uncertainties to zero. -
draw
Draws the function on a drawing panel.- Specified by:
drawin interfaceDrawable- Overrides:
drawin classFunctionDrawer- Parameters:
panel- the drawing panelg- the graphics context
-