JIDE 3.5.15

com.jidesoft.chart.fit
Class FunctionMap

java.lang.Object
  extended by com.jidesoft.chart.fit.FunctionMap

public class FunctionMap
extends Object

The idea is to provide a class that, given a chart model and an x or y value, can read off the corresponding value from the other axis. This assumes straight lines to join up consecutive points in the chart model.


Constructor Summary
FunctionMap()
           
 
Method Summary
static double getXApproximately(ChartModel model, double yIn)
          Returns the first point at which the line x = xIn crosses any of the line segments joining consecutive points of the chart model
static List<Double> getXsApproximately(ChartModel model, double yIn)
          Returns the first point at which the line x = xIn crosses any of the line segments joining consecutive points of the chart model
static double getYApproximately(ChartModel model, double xIn)
          Returns the first point at which the line x = xIn crosses any of the line segments joining consecutive points of the chart model
static List<Double> getYsApproximately(ChartModel model, double xIn)
          Returns all the points at which x = xIn crosses any of the line segments joining consecutive points of the chart model
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionMap

public FunctionMap()
Method Detail

getXApproximately

public static double getXApproximately(ChartModel model,
                                       double yIn)
                                throws ChartException
Returns the first point at which the line x = xIn crosses any of the line segments joining consecutive points of the chart model

Parameters:
model - the ChartModel of interest
yIn - the supplied y value
Returns:
the approximate X value corresponding to the supplied Y value
Throws:
ChartException

getXsApproximately

public static List<Double> getXsApproximately(ChartModel model,
                                              double yIn)
                                       throws BelowBoundsException,
                                              AboveBoundsException
Returns the first point at which the line x = xIn crosses any of the line segments joining consecutive points of the chart model

Parameters:
model - the model in which we are finding x values
yIn - the y value of interest
Returns:
the approximate X values corresponding to the given y value
Throws:
BelowBoundsException
AboveBoundsException

getYsApproximately

public static List<Double> getYsApproximately(ChartModel model,
                                              double xIn)
                                       throws BelowBoundsException,
                                              AboveBoundsException
Returns all the points at which x = xIn crosses any of the line segments joining consecutive points of the chart model

Parameters:
model - the chart model in which we are finding y values
xIn - the x value of interest
Returns:
the approximate y values corresponding to the given x value
Throws:
BelowBoundsException
AboveBoundsException

getYApproximately

public static double getYApproximately(ChartModel model,
                                       double xIn)
                                throws ChartException
Returns the first point at which the line x = xIn crosses any of the line segments joining consecutive points of the chart model

Parameters:
model - the chart model in which we are finding a y value
xIn - the x value of interest
Returns:
the approximate Y value corresponding to the supplied x value
Throws:
BelowBoundsException
AboveBoundsException
ChartException

JIDE 3.5.15