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
-
autoSlope
- If true the slope will be approximated automatically.
-
f
- The MathFunction object to which this line is tangent
-
fPrime
- The MathFunction object used to determine the derivative when autoSlope is false.
-
slope
- The slope of the line
-
xBase
- The x-coordinate of the base point
-
yBase
- The y-coordinate of the base point
-
EDU.emporia.mathbeans.TangentLine()
-
-
functionValue(double)
- Returns the y-coordinate of the tangent line corresponding to the given x
-
getBase()
- Returns the base point for the tangent line (The base point is the point on the
curve at which this line is tangent).
-
getF()
- Gets the MathFunction object that represents the curve to which this line will
be tangent
-
getFPrime()
- Gets the function to be used to compute the derivative of f.
-
getSlope()
- Gives the slope of the line
-
getXBase()
- Gets the x-value for the point on the curve to be used as a base point for the
tangent line
-
getYBase()
- Gives the y-coordinate of the base point on the curve
-
setF(MathFunction)
- Sets the MathFunction object that represents the curve to which this line will
be tangent
-
setFPrime(MathFunction)
- Sets the function to be used to compute the derivative of f.
-
setXBase(double)
- Sets the x-value for the point on the curve to be used as a base point for the
tangent line
-
updateSlope()
- Updates the slope.
autoSlope
protected boolean autoSlope
- If true the slope will be approximated automatically. If false it will be based on
the function fPrime
f
protected EDU.emporia.mathtools.MathFunction f
- The MathFunction object to which this line is tangent
fPrime
protected EDU.emporia.mathtools.MathFunction fPrime
- The MathFunction object used to determine the derivative when autoSlope is false.
slope
protected double slope
- The slope of the line
xBase
protected double xBase
- The x-coordinate of the base point
yBase
protected double yBase
- The y-coordinate of the base point
TangentLine
public TangentLine()
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
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).
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
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
getSlope
public double getSlope()
- Gives the slope of the line
- Returns:
- The slope
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
getYBase
public double getYBase()
- Gives the y-coordinate of the base point on the curve
- Returns:
- The y-coordinate of the base point
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
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
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
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