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

Class EDU.emporia.mathbeans.TangentLine

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

public class TangentLine
extends MathFunction
A class to be used to construct a tangent line to a curve that can be displayed on a MathGrapher

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

Variable Index

 o autoSlope
If true the slope will be approximated automatically.
 o f
The MathFunction object to which this line is tangent
 o fPrime
The MathFunction object used to determine the derivative when autoSlope is false.
 o slope
The slope of the line
 o xBase
The x-coordinate of the base point
 o yBase
The y-coordinate of the base point

Constructor Index

 o EDU.emporia.mathbeans.TangentLine()

Method Index

 o functionValue(double)
Returns the y-coordinate of the tangent line corresponding to the given x
 o getBase()
Returns the base point for the tangent line (The base point is the point on the curve at which this line is tangent).
 o getF()
Gets the MathFunction object that represents the curve to which this line will be tangent
 o getFPrime()
Gets the function to be used to compute the derivative of f.
 o getSlope()
Gives the slope of the line
 o getXBase()
Gets the x-value for the point on the curve to be used as a base point for the tangent line
 o getYBase()
Gives the y-coordinate of the base point on the curve
 o setF(MathFunction)
Sets the MathFunction object that represents the curve to which this line will be tangent
 o setFPrime(MathFunction)
Sets the function to be used to compute the derivative of f.
 o setXBase(double)
Sets the x-value for the point on the curve to be used as a base point for the tangent line
 o updateSlope()
Updates the slope.

Variables

 o autoSlope
protected boolean autoSlope
If true the slope will be approximated automatically. If false it will be based on the function fPrime

 o f
protected EDU.emporia.mathtools.MathFunction f
The MathFunction object to which this line is tangent

 o fPrime
protected EDU.emporia.mathtools.MathFunction fPrime
The MathFunction object used to determine the derivative when autoSlope is false.

 o slope
protected double slope
The slope of the line

 o xBase
protected double xBase
The x-coordinate of the base point

 o yBase
protected double yBase
The y-coordinate of the base point

Constructors

 o TangentLine
public TangentLine()

Methods

 o functionValue
public double functionValue(double a)
Returns the y-coordinate of the tangent line corresponding to the given x

Parameters:
a - The x-coordinate
Returns:
The y-coordinate
Overrides:
functionValue in class MathFunction
 o getBase
public EDU.emporia.mathtools.Point2D.Double getBase()
Returns the base point for the tangent line (The base point is the point on the curve at which this line is tangent).

 o getF
public EDU.emporia.mathtools.MathFunction getF()
Gets the MathFunction object that represents the curve to which this line will be tangent

Returns:
The curve
 o getFPrime
public EDU.emporia.mathtools.MathFunction getFPrime()
Gets the function to be used to compute the derivative of f.

Returns:
The derivative that is being used
 o getSlope
public double getSlope()
Gives the slope of the line

Returns:
The slope
 o getXBase
public double getXBase()
Gets the x-value for the point on the curve to be used as a base point for the tangent line

Returns:
The x-value of the base point
 o getYBase
public double getYBase()
Gives the y-coordinate of the base point on the curve

Returns:
The y-coordinate of the base point
 o setF
public void setF(MathFunction f)
Sets the MathFunction object that represents the curve to which this line will be tangent

Parameters:
f - The curve
 o setFPrime
public void setFPrime(MathFunction fPrime)
Sets the function to be used to compute the derivative of f. If this is not called the derivative will be approximated

Parameters:
fPrime - The derivative function
 o setXBase
public void setXBase(double xBase)
Sets the x-value for the point on the curve to be used as a base point for the tangent line

Parameters:
xBase - The x-value of the base point
 o updateSlope
public void updateSlope()
Updates the slope. Should be called if the curve or the base point is changed


All Packages  Class Hierarchy  This Package  Previous  Next  Index