Element Riemannsum
JXG.GeometryElement
↳ JXG.Curve
↳ Riemannsum
This element is used to provide a constructor for Riemann sums, which is realized as a special curve.
The returned element has the method Value() which returns the sum of the areas of the rectangles.
Defined in: curve.js.
Extends
JXG.Curve.
Constructor Attributes | Constructor Name and Description |
---|---|
- Methods borrowed from class JXG.Curve:
- addTransform, allocatePoints, checkReal, generateTerm, hasPoint, interpolationFunctionFromArray, isDistOK, isSegmentOutside, maxX, minX, notifyParents, setPosition, setPositionDirectly, update, updateCurve, updateDataArray, updateParametricCurve, updateParametricCurveNaive, updateRenderer, updateTransform, Z
- Methods borrowed from class JXG.GeometryElement:
- _set, addChild, addDescendants, addRotation, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getTextAnchor, getType, hideElement, labelColor, noHighlight, normalize, off, on, prepareUpdate, remove, removeChild, removeDescendants, resolveShortcuts, setArrow, setAttribute, setDash, setLabelText, showElement, triggerEventHandlers
- Events borrowed from class JXG.GeometryElement:
- attribute, attribute:<attribute><attribute>, down, drag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, touchdown, touchdrag, touchup, up
-
This element has no direct constructor. To create an instance of this element you have to call JXG.Board#create
with type "riemannsum".
- Possible parent array combinations are:
-
{function} f
{number|function} n
{string|function} type Optional
{function|number} a Optional
{function|number} b Optional
- Parent elements of Riemannsum are a
function term f(x) describing the function graph which is filled by the Riemann rectangles.
n determines the number of rectangles, it is either a fixed number or a function.
type is a string or function returning one of the values: 'left', 'right', 'middle', 'lower', 'upper', 'random', 'simpson', or 'trapezodial'. Default value is 'left'.
Further parameters are an optional number or function for the left interval border a, and an optional number or function for the right interval border b.
Default values are a=-10 and b=10.
- See:
- JXG.Curve
- Examples:
// Create Riemann sums for f(x) = 0.5*x*x-2*x. var s = board.create('slider',[[0,4],[3,4],[0,4,10]],{snapWidth:1}); var f = function(x) { return 0.5*x*x-2*x; }; var r = board.create('riemannsum', [f, function(){return s.Value();}, 'upper', -2, 5], {fillOpacity:0.4} ); var g = board.create('functiongraph',[f, -2, 5]); var t = board.create('text',[-1,-1, function(){ return 'Sum=' + r.Value().toFixed(4); }]);
- Attributes borrowed from class JXG.Curve:
- curveType, handDrawing
- Attributes borrowed from class JXG.GeometryElement:
- dash, draft, fillColor, fillOpacity, fixed, frozen, highlight, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, needsRegularUpdate, scalable, shadow, snapToGrid, strokeColor, strokeOpacity, strokeWidth, trace, traceAttributes, visible, withLabel
- Fields borrowed from class JXG.Curve:
- numberPoints
- Fields borrowed from class JXG.GeometryElement:
- _pos, addEvent, ancestors, baseElement, board, childElements, descendants, dump, elementClass, elType, eventHandlers, getProperty, hasLabel, highlighted, id, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, rendNode, setProperty, stdform, subs, symbolic, traces, transformations, type, visProp
- Methods borrowed from class JXG.Curve:
- addTransform, allocatePoints, checkReal, generateTerm, hasPoint, interpolationFunctionFromArray, isDistOK, isSegmentOutside, maxX, minX, notifyParents, setPosition, setPositionDirectly, update, updateCurve, updateDataArray, updateParametricCurve, updateParametricCurveNaive, updateRenderer, updateTransform, Z
- Methods borrowed from class JXG.GeometryElement:
- _set, addChild, addDescendants, addRotation, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getTextAnchor, getType, hideElement, labelColor, noHighlight, normalize, off, on, prepareUpdate, remove, removeChild, removeDescendants, resolveShortcuts, setArrow, setAttribute, setDash, setLabelText, showElement, triggerEventHandlers