|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.SineMaker
public class SineMaker
A utility class that can be used to create smoothly varying sinusoidal numerical data. Note that this is not a singleton class nor does it have static methods as its behavior depends on the minimum, maximum and delta values given to its constructor.
| Field Summary | |
|---|---|
private double |
_ampl
The amplitude of the sinusoidal output |
private double |
_delta
The amount that _theta is incremented each time, in radians. |
private double |
_mid
The midpoint of the min and max values. |
private double |
_theta
The current angle used to generate the current sinusoidal value. |
| Constructor Summary | |
|---|---|
SineMaker(double min,
double max,
double delta)
The constructor takes several values to control the object's behavior. |
|
| Method Summary | |
|---|---|
double |
getDblVal()
Returns a different value each time it is called. |
int |
getIntVal()
Same as getDblVal, but returns the result rounded to the nearest integer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private double _mid
private double _ampl
private double _delta
private double _theta
| Constructor Detail |
|---|
public SineMaker(double min,
double max,
double delta)
min - The minimum and initial value to produce.max - The maximum value to produce.delta - The amount in radians that the generating angle is incremented each time| Method Detail |
|---|
public double getDblVal()
public int getIntVal()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||