public class SplineSeries extends FunctionLineSeries
SplineSeries
is very similar to a LineSeries
class,
except that the line between the specified datapoints is "smoothed" by applying
a Spline curve. Two splines are supplied - the CATMULLROM_SPLINE
which
will pass through each point, or the B_SPLINE
, which does not pass through
each point and so is useful for filtering out extreme values.LineSeries
Modifier and Type | Field and Description |
---|---|
static double[][] |
B_SPLINE
Defines the basis matrix for a B-spline
|
static double[][] |
CATMULLROM_SPLINE
Defines the basis matrix for a Catmull-Rom spline
|
maxx, minx
Constructor and Description |
---|
SplineSeries(String name,
double[][] matrix)
Create a new SplineSeries
|
Modifier and Type | Method and Description |
---|---|
void |
complete()
Complete the function.
|
double |
func(double x)
Given an X value, return the equivalent Y value of this function.
|
void |
set(double x,
double y)
Set a value on the graph.
|
createFunctionSeries, getLineSeries, setLineSeries, setSteps
setDepth
addBox, addLine, addMarker, getName, outputToSeries, outputToSeriesFunction, setFloatingPointX, setFloatingPointY, setStyle, toString
public static final double[][] CATMULLROM_SPLINE
public static final double[][] B_SPLINE
public SplineSeries(String name, double[][] matrix)
name
- the name of the Seriesmatrix
- the nx4 matrix defining the spline. Typically either
CATMULLROM_SPLINE
or B_SPLINE
will be used, but a user-defined spline
can also be passed in.IllegalArgumentException
- if the spline matrix does not have 4 rows.public void set(double x, double y)
x
parameter specifies the horizontal
position on the graph, and the y
parameter specifies the vertical position.
Both must be real numbers.x
- the X co-ordinate of the sampley
- the Y co-ordinate of the samplepublic void complete()
FunctionLineSeries
super.complete()
first.complete
in class FunctionLineSeries
public double func(double x)
FunctionLineSeries
Double.NaN
or infinite, and either of those values
will result in a gap in the line.func
in class FunctionLineSeries
x
- the X-value of the function - guaranteed not to be NaN or InfiniteCopyright © 2001-2016 Big Faceless Organization