Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.faceless.graph.math
Class Curve

    java.lang.Object
      org.faceless.graph.math.Curve

Direct Known Subclasses:
  DataCurve, FunctionCurve

    public abstract class Curve

extends Object

The abstract superclass for all curves. A curve is what's plotted on a `AbstractLineGraph`, and has the property of always having a valid value between it's two end ranges - ie f(x) is valid for every min<=x<=max.

All curves fall into one of two broad subclasses - a `DataCurve`, where the values of the curve reflect various data points, and a `FunctionCurve`, where the values of the curve reflect a mathematical function.

See Also:
  `DataCurve`, `FunctionCurve`, `Spline`, `Polynomial`

Constructor Summary
`Curve()`

Method Summary
`abstract double` | `get(double x)` Return the value of this curve at the specified X position.
`abstract double` | `getMax()` Return the maximum value that is defined for this curve.
`abstract double` | `getMin()` Return the minimum value that is defined for this curve.
`abstract boolean` | `point(double x)` If a marker is to be placed at this point on the curve then return true, otherwise return false.
`abstract double[]` | `steps()` Return the points on the curve that it should be sampled at to get an accurate picture of it.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Curve

    public Curve()

Method Detail

### get

    public abstract double get(double x)

  Return the value of this curve at the specified X position. If the curve has no value at this point (i.e. x<curve min or x>curve max) return `Double.NaN`

### steps

    public abstract double[] steps()

  Return the points on the curve that it should be sampled at to get an accurate picture of it. Subclasses of `FunctionCurve` may return an empty list if they wish, or if there are certain points that the curve must be sampled at, it can return them here.

### point

    public abstract boolean point(double x)

  If a marker is to be placed at this point on the curve then return true, otherwise return false. Most `FunctionCurve` will return false, but curves that have been fitted to a `DataCurve` may return any points from that `DataCurve` that are matched exactly by the fitted curve.

### getMin

    public abstract double getMin()

  Return the minimum value that is defined for this curve. For curves with no minimum (like most mathematical functions), this should return `Double.POSITIVE_INFINITY` (yes, positive)

### getMax

    public abstract double getMax()

  Return the maximum value that is defined for this curve. For curves with no maximum (like most mathematical functions), this should return `Double.NEGATIVE_INFINITY` (yes, negative)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2012 Big Faceless Organization