sjm.examples.sling
Class Renderable
java.lang.Object
|
+--sjm.examples.sling.Renderable
- public class Renderable
- extends java.lang.Object
This class contains a Sling function and the number of
lines to use in rendering the function. Note that the
number of lines may itself be a function. Also note
that the number of lines to use when rendering will be
evaluated at the beginning of a plot, when time = 0.
At rendering time, the number of lines is:
nLine.eval().f(0).y
For example, nLine might be 100*s1 + t. Say the slider is
halfway over. At rendering time, t = 0 and nLine will
evaluate to 100*.5 + 0, or 50. The function f(0) returns a
point, which will be (0, 50). The y value of this point
is 50 and thus the number of lines to use will be 50.
|
Method Summary |
Extrema |
getExtrema()
Find the upper and lower points the function will reach,
given the number of points used to plot it. |
int |
nLine()
Return the number of lines to use to render this
function. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
function
protected SlingFunction function
nLine
protected SlingFunction nLine
Renderable
public Renderable(SlingFunction function,
SlingFunction nLine)
- Create a function that will be rendered with the given
number of lines.
- Parameters:
function - the sling function to rendernLine - the number of lines to use when
rendering; this may be any function
getExtrema
public Extrema getExtrema()
- Find the upper and lower points the function will reach,
given the number of points used to plot it.
- Returns:
- a pairing of the upper and lower points the
function will reach, given the number of points
used to plot it
nLine
public int nLine()
- Return the number of lines to use to render this
function.
- Returns:
- the number of lines to use to render this
function.