jhplot
Class F2D

java.lang.Object
  extended by jhplot.DrawOptions
      extended by jhplot.F2D
All Implemented Interfaces:
java.io.Serializable

public class F2D
extends DrawOptions
implements java.io.Serializable

Create 2D function.

See Also:
Serialized Form

Constructor Summary
F2D(hep.aida.IFunction iname)
          Create a F2D function from JAIDA IFunction.
F2D(hep.aida.IFunction iname, double Xmin, double Xmax, double Ymin, double Ymax)
          Create a F2D function from JAIDA IFunction.
F2D(java.lang.String name)
          Create a function in 2D for evaluation.
F2D(java.lang.String name, double Xmin, double Xmax, double Ymin, double Ymax)
          Create a function in 2D.
F2D(java.lang.String name, hep.aida.IFunction iname, double Xmin, double Xmax, double Ymin, double Ymax)
          Create a F2D function from JAIDA IFunction.
 
Method Summary
 void doc()
          Show online documentation.
 double[][] eval(double[] x, double[] y)
          Evaluate a function for an array of x-values
 double eval(double x, double y)
          Evaluate a function at a specific point in (x,y)
 double getMaxX()
          Get Max value in X
 double getMaxY()
          Get Max value in Y
 double getMinX()
          Get Min value in X
 double getMinY()
          Get Min value in Y
 java.lang.String getName()
          Get the name of the function used for evaluation
 graph.ParseFunction getParse()
          Return parsed function.
 int getPoints()
          Get the number of points for evaluation of a function
 java.lang.String getTitle()
          Get the title
 double integral(int N, double minX, double maxX, double minY, double maxY)
          Numerical integration using trapezium rule.
 void setMaxX(double max)
          Set Max value in X
 void setMaxY(double max)
          Set Max value in Y
 void setMinX(double min)
          Set Min in X
 void setMinY(double min)
          Set Min value in Y
 void setName(java.lang.String name)
          Sets a name of the function, i.e.
 void setPoints(int bins)
          Get the number of points
 void setTitle(java.lang.String title)
          Set a title
 
Methods inherited from class jhplot.DrawOptions
copyLinePars, getBinWidth, getColor, getDrawOption, getDrawOptions, getLegend, getLineParm, getNameX, getNameY, getNameZ, getSymbol, getType, printDrawOptions, printDrawOptions, setBinWidth, setColor, setDrawLine, setDrawLineKey, setDrawOption, setDrawSymbol, setErr, setErrAll, setErrColor, setErrColorX, setErrColorY, setErrFill, setErrFillColor, setErrFillColor, setErrSys, setErrSysFill, setErrSysFillColor, setErrSysFillColor, setErrSysX, setErrSysY, setErrTicSize, setErrX, setErrY, setFill, setFillColor, setFillColorTransparency, setGraphStyle, setLegend, setNameX, setNameY, setNameZ, setPenDash, setPenDash, setPenWidth, setPenWidthErr, setPenWidthErrSys, setStyle, setSymbol, setSymbolSize, setType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

F2D

public F2D(java.lang.String name)
Create a function in 2D for evaluation. The function may have up to 2 independent variables: x,y.

If the answer is wrong then use the parenthesis to force the order of evaluation. The most likely place this will be needed is in the use of the power command. The exponent is not evaluated correctly if it begins with a unary operator.

List of commands

Parameters:
name - String representing the function

F2D

public F2D(java.lang.String name,
           double Xmin,
           double Xmax,
           double Ymin,
           double Ymax)
Create a function in 2D. Uses 500 points between min and max value for evaluation. The function may have up to 2 independent variables in it (x,y).

If the answer is wrong then use the parenthesis to force the order of evaluation. The most likely place this will be needed is in the use of the power command. The exponent is not evaluated correctly if it begins with a unary operator.

List of commands

Parameters:
name - String representing the function.
Xmin - Min value in X
Xmax - Max value in X
Ymin - Min value in Y
Ymax - Max value in Y

F2D

public F2D(java.lang.String name,
           hep.aida.IFunction iname,
           double Xmin,
           double Xmax,
           double Ymin,
           double Ymax)
Create a F2D function from JAIDA IFunction. By default, 500 points for evaluation are used

Parameters:
name - new function name
iname - input IFunction
Xmin - Min X value
Xmax - Max X value
Ymin - Min Y value
Ymax - Max Y value

F2D

public F2D(hep.aida.IFunction iname)
Create a F2D function from JAIDA IFunction. By default, 500 points for evaluation are used.

Parameters:
iname -

F2D

public F2D(hep.aida.IFunction iname,
           double Xmin,
           double Xmax,
           double Ymin,
           double Ymax)
Create a F2D function from JAIDA IFunction.

Parameters:
iname - input IFunction
Xmin - Min X value
Xmax - Max X value
Ymin - Min Y value
Ymax - Max Y value
Method Detail

eval

public double eval(double x,
                   double y)
Evaluate a function at a specific point in (x,y)

Parameters:
x - value in x for evaluation
y - value in y for evaluation
Returns:
function value at (x,y)

eval

public double[][] eval(double[] x,
                       double[] y)
Evaluate a function for an array of x-values

Parameters:
x - array of values in x for evaluation
y - array of values in y for evaluation
Returns:
array of function values

setTitle

public void setTitle(java.lang.String title)
Set a title

Overrides:
setTitle in class DrawOptions
Parameters:
title - Title

getTitle

public java.lang.String getTitle()
Get the title

Overrides:
getTitle in class DrawOptions
Returns:
Title

setMinX

public void setMinX(double min)
Set Min in X

Parameters:
min - Min value

getMinX

public double getMinX()
Get Min value in X

Returns:
Min value in X

setMinY

public void setMinY(double min)
Set Min value in Y

Parameters:
min - Min value in Y

doc

public void doc()
Show online documentation.


getMinY

public double getMinY()
Get Min value in Y

Returns:
Min value in Y

setMaxX

public void setMaxX(double max)
Set Max value in X

Parameters:
max - Max value in X

setName

public void setName(java.lang.String name)
Sets a name of the function, i.e. what will be used for evaluation

Parameters:
name - Name

getName

public java.lang.String getName()
Get the name of the function used for evaluation

Returns:
Name

getMaxX

public double getMaxX()
Get Max value in X

Returns:
Max value in X

setMaxY

public void setMaxY(double max)
Set Max value in Y

Parameters:
max - Max value in Y

getMaxY

public double getMaxY()
Get Max value in Y

Returns:
Max value in Y

setPoints

public void setPoints(int bins)
Get the number of points

Parameters:
bins - Number of points

getPoints

public int getPoints()
Get the number of points for evaluation of a function

Returns:
Number of points

integral

public double integral(int N,
                       double minX,
                       double maxX,
                       double minY,
                       double maxY)
Numerical integration using trapezium rule.

Parameters:
N - the number of strips to use for integration (in X and Y the same)
minX - the first ordinate in X.
maxX - the last ordinate in X.
minY - the first ordinate in X.
maxY - the last ordinate in Y.
Returns:
integral

getParse

public graph.ParseFunction getParse()
Return parsed function. One can evaluate as: z =function.getResult(x,y), where function is what returned by this method.

Returns:
function


jHepWork 2.1 (C) S.Chekanov