Class EDU.emporia.mathbeans.RandomPLFunction
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.emporia.mathbeans.RandomPLFunction

Object
   |
   +----MathFunction
           |
           +----EDU.emporia.mathbeans.RandomPLFunction

public class RandomPLFunction
extends MathFunction
An object of this class will generate a random piecewise linear function that can be used in examples.

Version:
1.0
Author:
Joe Yanik
Since:
7/7/00

Variable Index

 o xLeft
The x-coordinate of the left hand point used to construct the function.
 o xRight
The x-coordinate of the right hand point used to construct the function.
 o yLeft
The y-coordinate of the left hand point used to construct the function.
 o yLeftEnd
The y-coordinate of the point at x=-10.
 o yRight
The y-coordinate of the right hand point used to construct the function.
 o yRightEnd
The y-coordinate of the point at x=10.

Constructor Index

 o EDU.emporia.mathbeans.RandomPLFunction()
No-argument constructor

Method Index

 o functionValue(double)
Returns the function evaluated at the given value
 o randomChoice(double, double)
Picks a random number between the given parameters
 o randomize()
This method will select random values for the parameters used to construct the random piecewise linear function

Variables

 o xLeft
protected double xLeft
The x-coordinate of the left hand point used to construct the function. It will be between -6 and -2.

 o xRight
protected double xRight
The x-coordinate of the right hand point used to construct the function. It will be between -6 and -2.

 o yLeft
protected double yLeft
The y-coordinate of the left hand point used to construct the function. It will be between -10 and 10.

 o yLeftEnd
protected double yLeftEnd
The y-coordinate of the point at x=-10.

 o yRight
protected double yRight
The y-coordinate of the right hand point used to construct the function. It will be between -10 and 10.

 o yRightEnd
protected double yRightEnd
The y-coordinate of the point at x=10.

Constructors

 o RandomPLFunction
public RandomPLFunction()
No-argument constructor

Methods

 o functionValue
public double functionValue(double u)
Returns the function evaluated at the given value

Parameters:
u - The x-value at which the function will be evaluated
Returns:
The value of the function at u.
Overrides:
functionValue in class MathFunction
 o randomChoice
public double randomChoice(double a,
                           double b)
Picks a random number between the given parameters

Parameters:
a - The lower bound for the interval from which the random number is chosen
b - The upper bound for the interval from which the random number is chosen
Returns:
A random number between a and b
 o randomize
public void randomize()
This method will select random values for the parameters used to construct the random piecewise linear function


All Packages  Class Hierarchy  This Package  Previous  Next  Index