Class Index | File Index

Classes


Class Riemannsum


Extends JXG.Curve.
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.

Class Summary
Constructor Attributes Constructor Name and Description
 
Riemannsum(f,n,type_,a_,b_)
Fields borrowed from class JXG.Curve:
curveType, handDrawing, numberPoints
Fields borrowed from class JXG.GeometryElement:
addEvent, ancestors, board, childElements, dash, descendants, draft, dump, elementClass, elType, eventHandlers, fillColor, fillOpacity, fixed, frozen, getAttribute, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isDraggable, isReal, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, type, visible, visProp, withLabel
Methods borrowed from class JXG.Curve:
addTransform, allocatePoints, generateTerm, hasPoint, isDistOK, isSegmentOutside, maxX, minX, notifyParents, setPosition, setPositionDirectly, update, updateCurve, updateDataArray, updateParametricCurve, updateParametricCurveNaive, updateRenderer, updateTransform, Z
Methods borrowed from class JXG.GeometryElement:
addChild, addRotation, animate, bounds, clearTrace, cloneToBackground, createLabel, getAttributes, getLabelAnchor, getName, getParents, getProperty, getTextAnchor, getType, hideElement, labelColor, noHighlight, off, on, remove, resolveShortcuts, setArrow, setAttribute, setLabelText, setProperty, 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
Class Detail
Riemannsum(f,n,type_,a_,b_)
// 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); }]);

				
				
				
				
					
						
Parameters:
{function_number|function_string|function_function|number_function|number} f,n,type_,a_,b_
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', 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

Documentation generated by JsDoc Toolkit 2.4.0 on Thu May 30 2013 23:22:19 GMT+0200 (CEST)