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
-
xLeft
- The x-coordinate of the left hand point used to construct the function.
-
xRight
- The x-coordinate of the right hand point used to construct the function.
-
yLeft
- The y-coordinate of the left hand point used to construct the function.
-
yLeftEnd
- The y-coordinate of the point at x=-10.
-
yRight
- The y-coordinate of the right hand point used to construct the function.
-
yRightEnd
- The y-coordinate of the point at x=10.
-
EDU.emporia.mathbeans.RandomPLFunction()
- No-argument constructor
-
functionValue(double)
- Returns the function evaluated at the given value
-
randomChoice(double, double)
- Picks a random number between the given parameters
-
randomize()
- This method will select random values for the parameters used to construct the
random piecewise linear function
xLeft
protected double xLeft
- The x-coordinate of the left hand point used to construct the function. It will
be between -6 and -2.
xRight
protected double xRight
- The x-coordinate of the right hand point used to construct the function. It will
be between -6 and -2.
yLeft
protected double yLeft
- The y-coordinate of the left hand point used to construct the function. It will
be between -10 and 10.
yLeftEnd
protected double yLeftEnd
- The y-coordinate of the point at x=-10.
yRight
protected double yRight
- The y-coordinate of the right hand point used to construct the function. It will
be between -10 and 10.
yRightEnd
protected double yRightEnd
- The y-coordinate of the point at x=10.
RandomPLFunction
public RandomPLFunction()
- No-argument constructor
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
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
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