|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.quies.math.plot.IndexScheme
net.quies.math.plot.LinearIndexScheme
public abstract class LinearIndexScheme
Subclasses of this class provide a linear axis index.
| Constructor Summary | |
|---|---|
protected |
LinearIndexScheme()
|
| Method Summary | |
|---|---|
protected abstract BigDecimal |
getStepsize(BigDecimal preferredStepsize)
Gets a suitable stepsize which will produce a number of steps as close as possible tho the ideal with preferredStepsize. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected LinearIndexScheme()
| Method Detail |
|---|
protected abstract BigDecimal getStepsize(BigDecimal preferredStepsize)
preferredStepsize.
The therm suitable is defined by the subclass of this class. If preferredStepsize is not a suitable stepsize
this method must decide wheather to use a smaller or a larger one with the following algorithm.
Let a be the largest suitable stepsize less than preferredStepsize and let b be the smallest
suitable stepsize greather than preferredStepsize.
Let r be the range of the dimension which is the diference between the highest and the lowest value.
The break point x lies where a is equally wrong than b so x is where the number of steps to many with a is equal to the number of steps short with b.
r/a - r/x = r/x - r/b 1/a + 1/b = 1/x + 1/x b/ab + a/ab = 2/x 2/x = (a+b)/ab x = 2ab/(a+b)For example the break point between stepsize 1 and stepsize 2 is 4/3.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||