Package com.katiejergens.riemannSum
Class RightHandPlot
- java.lang.Object
-
- com.katiejergens.riemannSum.AbstractRiemann
-
- com.katiejergens.riemannSum.RightHandPlot
-
public class RightHandPlot extends AbstractRiemann
-
-
Field Summary
-
Fields inherited from class com.katiejergens.riemannSum.AbstractRiemann
plotFrame, poly, subintervals, xLower, xUpper
-
-
Constructor Summary
Constructors Constructor Description RightHandPlot(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.double
getSubintervalArea(double leftBorder, double rightBorder)
Estimate the area under the given poly between the interval.-
Methods inherited from class com.katiejergens.riemannSum.AbstractRiemann
calculateDeltaX, configPlotFrame, drawRiemannSlices, getIntervalArea, plotAccFnc, plotPolynomial
-
-
-
-
Constructor Detail
-
RightHandPlot
public RightHandPlot(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)
Estimate the area under the given poly between the interval.- 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 under the poly for this getSubintervalArea.
-
drawSlice
public void drawSlice(double leftBorder, double rightBorder)
Plot the slice under the given poly.- Specified by:
drawSlice
in classAbstractRiemann
- Parameters:
leftBorder
- The left x-coordinate of the getSubintervalArearightBorder
- The right x-coordinate of the getSubintervalArea
-
-