Functiongraph

Element

A functiongraph visualizes a map \(f: [a, b] \to {\mathbb R}, x \mapsto f(x)\). The graph is displayed for x in the interval [a,b] and is a Curve element.

Since function terms can be given as JessieCode strings, users can avoid the somewhat bulky JavaScript syntax like Math.sin(x) and supply sin(x) instead.

Usage (signatures)
board.create('functiongraph', [f, aopt, bopt]);
Parameters
Name Type Attributes Description
f function | String | Number

Function term f(x) describing the function graph. Can also be a JessieCode string.

a Number | function <optional>

Left interval border a of the domain of f

b Number | function <optional>

Right interval border a of the domain of f

Examples

Function given as JavaScript function

// Create a function graph for f(x) = 0.5*x*x-2*x
  var graph = board.create('functiongraph',
                       [function(x){ return 0.5*x*x-2*x;}, -2, 4]
                    );

Function given as JessieCode string

const f1 = board.create("functiongraph", ["sin(x)"], { fixed: false });

// Create a function graph for f(x) = 0.5*x*x-2*x with variable interval
  var s = board.create('slider',[[0,4],[3,4],[-2,4,5]]);
  var graph = board.create('functiongraph',
                       [function(x){ return 0.5*x*x-2*x;},
                        -2,
                        function(){return s.Value();}]
                    );
Attributes

Own

RDPsmoothing

Description

Remove data points from the function graph which do not influence its appearance. In some cases this makes JSXGraph run much faster, especially if this function graph has glider points or has dependent curves like inequality or curve intersection/union/difference.

Implements the Ramer-Douglas-Peucker algorithm.

Type
Boolean
Default Value
true
See
Source
options.js, line 5493

label

Description

Attributes for functiongraph label.

Type
Label
Source
options.js, line 5482

Inherited

Members

Own

none

Inherited

Methods

Own

none

Inherited

Events

Own

none

Inherited

Extends