monotonic
Class StraightEnvelope


java.lang.Object

  extended bymonotonic.StraightEnvelope

All Implemented Interfaces:
Envelope, java.io.Serializable

public class StraightEnvelope
extends java.lang.Object
implements Envelope, java.io.Serializable

Defines a straight line as an envelope. Implements Envelope and Serializable interface. Line is in the format of f = offset + angle * x

Author:
A.K.Nircan
See Also:
Serialized Form

Field Summary
private  double angle
           
private  double offset
           
 
Constructor Summary
StraightEnvelope(double offset, double angle)
          StraightEnvelope constructor.
 
Method Summary
 double f(double x)
          Returns the f(x) for the given x.
 double getAngle()
           
 double getOffset()
           
 void setAngle(double d)
          Sets the angle
 void setOffset(double d)
          Sets the offset
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

offset


private double offset

angle


private double angle
Constructor Detail

StraightEnvelope


public StraightEnvelope(double offset,
                        double angle)
StraightEnvelope constructor. f = offset + angle * x

Parameters:
offset -
angle - in radians
Method Detail

f


public final double f(double x)
Description copied from interface: Envelope
Returns the f(x) for the given x.

Specified by:
f in interface Envelope
Parameters:
x -
Returns:
f(x)

getAngle


public double getAngle()
Returns:
the angle of this straight envelope in radians

getOffset


public double getOffset()
Returns:
the offset of this straight envelope

setAngle


public void setAngle(double d)
Sets the angle

Parameters:
d - angle in radians

setOffset


public void setOffset(double d)
Sets the offset

Parameters:
d -

toString


public java.lang.String toString()