|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.perisic.function.AnyFunction com.perisic.function.LinearFunction
public class LinearFunction
A linear function. Nice means here roughly mostly continuous (only a small number of jumps) where the pieces are either constants or defined by cubic polynomials.
Copyright:(c) Marc Conrad, Tim French 2010; Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument. DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
Constructor Summary | |
---|---|
LinearFunction(double valueAt0,
double valueAt1)
Generates the linear functions through the points (0,valueAt0) and (1,valueAt1). |
|
LinearFunction(double x1,
double y1,
double x2,
double y2)
Computes the linear function y = ax + b through the points (x1,y1) and (x2,y2). |
Method Summary | |
---|---|
double |
eval(double x)
Evaluates the linear function at x. |
Methods inherited from class com.perisic.function.AnyFunction |
---|
addToImage, addToImage, getImage, getImage, main, normalizeResult |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LinearFunction(double valueAt0, double valueAt1)
valueAt0
- the value at 0.valueAt1
- the value at 1.public LinearFunction(double x1, double y1, double x2, double y2)
x1
- x-coordinate of (x1,y1).y1
- y-coordinate of (x1,y1).x2
- x-coordinate of (x2,y2).y2
- y-coordinate of (x2,y2).Method Detail |
---|
public double eval(double x)
eval
in class AnyFunction
x
- The value against which the function is evaluated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |