Class SineMaker


class SineMaker
extends Object
This class is used to create a sine wave oscillation of an integer value between specified minimum and maximum values. This is accomplished through successive calls to next(). The oscillation rate is controlled by a parameter that sets the angular increment between calls to next().


Variable Index

 o dtheta
The angular increment between calls to next(), in radians
 o mid
The mid-point of the oscillation, i
 o range
The range of the oscillation from mid-point to extrema, i
 o theta
The current angular position, in radians

Constructor Index

 o SineMaker (int, int, double)
The constructor for SineMaker

Method Index

 o next ()
Returns the next value of the sine wave oscillation

Variables

 o mid
private double mid
The mid-point of the oscillation, i.e. the offset zero point.

 o range
private double range
The range of the oscillation from mid-point to extrema, i.e. the amplitude.

 o dtheta
private double dtheta
The angular increment between calls to next(), in radians.

 o theta
private double theta
The current angular position, in radians.

Constructors

 o SineMaker
public  SineMaker(int min, int max, double dtheta)
The constructor for SineMaker. It takes three arguments.

Parameters:
min - The minimum return value for next()
max - The maximum return value for next()
dtheta - The angular increment per call to next()

Methods

 o next
public int next()
Returns the next value of the sine wave oscillation.