public class SineMaker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
SineMaker(double min,
double max,
double delta)
The constructor takes several values to control the object's behavior.
|
Modifier and Type | Method and Description |
---|---|
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.
|
private double _mid
private double _ampl
private double _delta
private double _theta
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 timepublic double getDblVal()
public int getIntVal()