Package com.katiejergens.riemannSum
Class LeftHandPlot
- java.lang.Object
-
- com.katiejergens.riemannSum.AbstractRiemann
-
- com.katiejergens.riemannSum.LeftHandPlot
-
public class LeftHandPlot extends AbstractRiemann
-
-
Field Summary
-
Fields inherited from class com.katiejergens.riemannSum.AbstractRiemann
plotFrame, poly, subintervals, xLower, xUpper
-
-
Constructor Summary
Constructors Constructor Description LeftHandPlot(org.dalton.polyfun.Polynomial polynomial, double xLower, double xUpper, int subintervals)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drawSlice(double leftBorder, double rightBorder)
Plot the slice under the given poly using the Left Hand Rule.double
getSubintervalArea(double leftBorder, double rightBorder)
Calculate area of a single slice with Left Hand Rule.-
Methods inherited from class com.katiejergens.riemannSum.AbstractRiemann
calculateDeltaX, configPlotFrame, drawRiemannSlices, getIntervalArea, plotAccFnc, plotPolynomial
-
-
-
-
Constructor Detail
-
LeftHandPlot
public LeftHandPlot(org.dalton.polyfun.Polynomial polynomial, double xLower, double xUpper, int subintervals)
Constructor. Calls the constructor for AbstractRiemann and also sets the plot frame title.- Parameters:
polynomial
- The poly to get the area underxLower
- The left border of the intervalxUpper
- The right border of the intervalsubintervals
- The number of slices in the interval
-
-
Method Detail
-
getSubintervalArea
public double getSubintervalArea(double leftBorder, double rightBorder)
Calculate area of a single slice with Left Hand Rule.- Specified by:
getSubintervalArea
in classAbstractRiemann
- Parameters:
leftBorder
- The x-coordinate of the left border of the getSubintervalArearightBorder
- The x-coordinate of the right border of the getSubintervalArea- Returns:
- the area as a double
-
drawSlice
public void drawSlice(double leftBorder, double rightBorder)
Plot the slice under the given poly using the Left Hand Rule.- Specified by:
drawSlice
in classAbstractRiemann
- Parameters:
leftBorder
- The left x-coordinate of the slicerightBorder
- The right x-coordinate of the slice
-
-