# JSXGraph Reference

## JavaScript must be enabled in order for you to use JSXGraph and JSXGraph reference. However, it seems JavaScript is either disabled or not supported by your browser.

Class Index | File Index

## Elements

## Classes

- _global_
- Angle
- Arc
- Arrow
- Arrowparallel
- Axis
- Bisector
- Bisectorlines
- Button
- Checkbox
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Conic
- Curve
- Ellipse
- Functiongraph
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Circle
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Dump
- JXG.EventEmitter
- JXG.GeometryElement
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Line
- JXG.Math
- JXG.Math.Geometry
- JXG.Math.Numerics
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.Statistics
- JXG.Math.Symbolic
- JXG.NoRenderer
- JXG.Options
- JXG.Point
- JXG.Polygon
- JXG.Server
- JXG.Server.modules
- JXG.SVGRenderer
- JXG.Text
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.VMLRenderer
- JXG.XML
- Label
- Line
- Locus
- MajorArc
- MajorSector
- Midpoint
- MinorArc
- MinorSector
- Mirrorpoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelpoint
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Point
- PolarLine
- PolePoint
- Polygon
- Quadtree
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopetriangle
- Spline
- Stepfunction
- Tangent
- Tapemeasure
- Text
- Ticks
- Tracecurve
- Transformation
- Turtle

# Namespace JXG.Math

↳ JXG.Math

Defined in: math.js.

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.Math Math namespace.

Field Summary
Field Attributes | Field Name and Description
--- | ---
<static> | JXG.Math.eps eps defines the closeness to zero.
<static> | JXG.Math.sign The sign() function returns the sign of a number, indicating whether the number is positive, negative or zero.

Method Summary
Method Attributes | Method Name and Description
--- | ---
<static> | JXG.Math.binomial(n, k) Computes the binomial coefficient n over k.
<static> | JXG.Math.cosh(x) Calculates the cosine hyperbolicus of x.
<static> | JXG.Math.crossProduct(c1, c2) Calculates the cross product of two vectors both of length three.
<static> | JXG.Math.factorial(n) Compute the factorial of a positive integer.
<static> | JXG.Math.frustum(l, r, t, b, n, f) Generates a 4x4 matrix for 3D to 2D projections.
<static> | JXG.Math.gcd(a, b) Greatest common divisor (gcd) of two numbers.
<static> | JXG.Math.identity(n, m) Generates an identity matrix.
<static> | JXG.Math.innerProduct(a, b, n) Inner product of two vectors a and b.
<static> | JXG.Math.inverse(Ain) Compute the inverse of an nxn matrix with Gauss elimination.
<static> | JXG.Math.log(x, b) Logarithm to arbitrary base b.
<static> | JXG.Math.log10(x) Logarithm to base 10.
<static> | JXG.Math.log2(x) Logarithm to base 2.
<static> | JXG.Math.matMatMult(mat1, mat2) Computes the product of the two matrices mat1*mat2.
<static> | JXG.Math.matrix(n, m, init) Initializes a matrix as an array of rows with the given value.
<static> | JXG.Math.matVecMult(mat, vec) Multiplies a vector vec to a matrix mat: mat * vec.
<static> | JXG.Math.mod(a, m) The JavaScript implementation of the % operator returns the symmetric modulo.
<private> <static> | JXG.Math.normalize(stdform) Normalize the standard form [c, b0, b1, a, k, r, q0, q1].
<static> | JXG.Math.pow(base, exponent) Compute base to the power of exponent.
<static> | JXG.Math.projection(fov, ratio, n, f) Generates a 4x4 matrix for 3D to 2D projections.
<static> | JXG.Math.relDif(a, b) Determine the relative difference between two numbers.
<static> | JXG.Math.sinh(x) Sine hyperbolicus of x.
<static> | JXG.Math.squampow(base, exponent) A square & multiply algorithm to compute base to the power of exponent.
<static> | JXG.Math.toGL(m) Converts a two dimensional array to a one dimensional Float32Array that can be processed by WebGL.
<static> | JXG.Math.transpose(M) Transposes a matrix given as a two dimensional array.
<static> | JXG.Math.vector(n, init) Initializes a vector as an array with the coefficients set to the given value resp.

Namespace Detail
JXG.Math
Math namespace.
Field Detail
<static> {number} JXG.Math.eps
eps defines the closeness to zero. If the absolute value of a given number is smaller than eps, it is considered to be equal to zero.

<static> {[type]} JXG.Math.sign
The sign() function returns the sign of a number, indicating whether the number is positive, negative or zero.
Method Detail
<static> {Number} JXG.Math.binomial(n, k)
Computes the binomial coefficient n over k.

Parameters:
{Number} n
  Fraction will be ignored
{Number} k
  Fraction will be ignored

Returns:
  {Number} The binomial coefficient n over k

<static> {Number} JXG.Math.cosh(x)
Calculates the cosine hyperbolicus of x.

Parameters:
{Number} x
  The number the cosine hyperbolicus will be calculated of.

Returns:
  {Number} Cosine hyperbolicus of the given value.

<static> {Array} JXG.Math.crossProduct(c1, c2)
Calculates the cross product of two vectors both of length three. In case of homogeneous coordinates this is either

- the intersection of two lines
- the line through two points

Parameters:
{Array} c1
  Homogeneous coordinates of line or point 1
{Array} c2
  Homogeneous coordinates of line or point 2

Returns:
  {Array} vector of length 3: homogeneous coordinates of the resulting point / line.

<static> {Number} JXG.Math.factorial(n)
Compute the factorial of a positive integer. If a non-integer value is given, the fraction will be ignored.

Parameters:
{Number} n

Returns:
  {Number} n! = n*(n-1)*...*2*1

<static> {Array} JXG.Math.frustum(l, r, t, b, n, f)
Generates a 4x4 matrix for 3D to 2D projections.

Parameters:
{Number} l
  Left
{Number} r
  Right
{Number} t
  Top
{Number} b
  Bottom
{Number} n
  Near
{Number} f
  Far

Returns:
  {Array} 4x4 Matrix

<static> {Number} JXG.Math.gcd(a, b)
Greatest common divisor (gcd) of two numbers.

Parameters:
{Number} a
  First number
{Number} b
  Second number

Returns:
  {Number} gcd(a, b) if a and b are numbers, NaN else.

See:
  http://rosettacode.org/wiki/Greatest_common_divisor#JavaScript

<static> {Array} JXG.Math.identity(n, m)
Generates an identity matrix. If n is a number and m is undefined or not a number, a square matrix is generated, if n and m are both numbers, an nxm matrix is generated.

Parameters:
{Number} n
  Number of rows
{Number} m Optional, Default: n
  Number of columns

Returns:
  {Array} A square matrix of length `n` with all coefficients equal to 0 except a_(i,i), i out of (1, ..., n), if `m` is undefined or not a number or a `n` times `m`-matrix with a_(i,j) = 0 and a_(i,i) = 1 if m is a number.

<static> {Number} JXG.Math.innerProduct(a, b, n)
Inner product of two vectors a and b. n is the length of the vectors.

Parameters:
{Array} a
  Vector
{Array} b
  Vector
{Number} n Optional
  Length of the Vectors. If not given the length of the first vector is taken.

Returns:
  {Number} The inner product of a and b.

<static> {Array} JXG.Math.inverse(Ain)
Compute the inverse of an nxn matrix with Gauss elimination.

Parameters:
{Array} Ain

Returns:
  {Array} Inverse matrix of Ain

<static> {Number} JXG.Math.log(x, b)
Logarithm to arbitrary base b. If b is not given, natural log is taken, i.e. b = e.

Parameters:
{Number} x
{Number} b
  base

Returns:
  {Number} log(x, b) Logarithm of x to base b, that is log(x)/log(b).

<static> {Number} JXG.Math.log10(x)
Logarithm to base 10.

Parameters:
{Number} x

Returns:
  {Number} log10(x) Logarithm of x to base 10.

<static> {Number} JXG.Math.log2(x)
Logarithm to base 2.

Parameters:
{Number} x

Returns:
  {Number} log2(x) Logarithm of x to base 2.

<static> {Array} JXG.Math.matMatMult(mat1, mat2)
Computes the product of the two matrices mat1*mat2.

Parameters:
{Array} mat1
  Two dimensional array of numbers
{Array} mat2
  Two dimensional array of numbers

Returns:
  {Array} Two dimensional Array of numbers containing result

<static> {Array} JXG.Math.matrix(n, m, init)
Initializes a matrix as an array of rows with the given value.

Parameters:
{Number} n
  Number of rows
{Number} m Optional, Default: n
  Number of columns
{Number} init Optional, Default: 0
  Initial value for each coefficient

Returns:
  {Array} A `n` times `m`-matrix represented by a two-dimensional array. The inner arrays hold the columns, the outer array holds the rows.

<static> {Array} JXG.Math.matVecMult(mat, vec)
Multiplies a vector vec to a matrix mat: mat * vec. The matrix is interpreted by this function as an array of rows. Please note: This function does not check if the dimensions match.

Parameters:
{Array} mat
  Two dimensional array of numbers. The inner arrays describe the columns, the outer ones the matrix' rows.
{Array} vec
  Array of numbers

Returns:
  {Array} Array of numbers containing the result

Examples:

    var A = [[2, 1],
             [1, 3]],
        b = [4, 5],
        c;
    c = JXG.Math.matVecMult(A, b)
    // c === [13, 19];

<static> {Number} JXG.Math.mod(a, m)
The JavaScript implementation of the % operator returns the symmetric modulo. They are both identical if a >= 0 and m >= 0 but the results differ if a or m < 0.

Parameters:
{Number} a
{Number} m

Returns:
  {Number} Mathematical modulo `a mod m`

<private> <static> {Array} JXG.Math.normalize(stdform)
Normalize the standard form [c, b0, b1, a, k, r, q0, q1].

Parameters:
{Array} stdform
  The standard form to be normalized.

Returns:
  {Array} The normalized standard form.

<static> {Number} JXG.Math.pow(base, exponent)
Compute base to the power of exponent.

Parameters:
{Number} base
{Number} exponent

Returns:
  {Number} base to the power of exponent.

<static> {Array} JXG.Math.projection(fov, ratio, n, f)
Generates a 4x4 matrix for 3D to 2D projections.

Parameters:
{Number} fov
  Field of view in vertical direction, given in rad.
{Number} ratio
  Aspect ratio of the projection plane.
{Number} n
  Near
{Number} f
  Far

Returns:
  {Array} 4x4 Projection Matrix

<static> {Number} JXG.Math.relDif(a, b)
Determine the relative difference between two numbers.

Parameters:
{Number} a
  First number
{Number} b
  Second number

Returns:
  {Number} Relative difference between a and b: |a-b| / max(|a|, |b|)

<static> {Number} JXG.Math.sinh(x)
Sine hyperbolicus of x.

Parameters:
{Number} x
  The number the sine hyperbolicus will be calculated of.

Returns:
  {Number} Sine hyperbolicus of the given value.

<static> {Number} JXG.Math.squampow(base, exponent)
A square & multiply algorithm to compute base to the power of exponent. Implementated by Wolfgang Riedl.

Parameters:
{Number} base
{Number} exponent

Returns:
  {Number} Base to the power of exponent

<static> {Float32Array} JXG.Math.toGL(m)
Converts a two dimensional array to a one dimensional Float32Array that can be processed by WebGL.

Parameters:
{Array} m
  A matrix in a two dimensional array.

Returns:
  {Float32Array} A one dimensional array containing the matrix in column wise notation. Provides a fall back to the default JavaScript Array if Float32Array is not available.

<static> {Array} JXG.Math.transpose(M)
Transposes a matrix given as a two dimensional array.

Parameters:
{Array} M
  The matrix to be transposed

Returns:
  {Array} The transpose of M

<static> {Array} JXG.Math.vector(n, init)
Initializes a vector as an array with the coefficients set to the given value resp. zero.

Parameters:
{Number} n
  Length of the vector
{Number} init Optional, Default: 0
  Initial value for each coefficient

Returns:
  {Array} A `n` times `m`-matrix represented by a two-dimensional array. The inner arrays hold the columns, the outer array holds the rows.

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Aug 23 2017 17:12:47 GMT-0000 (UTC)