# 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

- Angle
- Arc
- Arrow
- Arrowparallel
- Axis
- Bisector
- Bisectorlines
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- Circumcirclesector
- Conic
- Curve
- Ellipse
- Functiongraph
- Glider
- Grid
- Hyperbola
- Image
- Incenter
- Incircle
- Integral
- Intersection
- Line
- Locus
- Midpoint
- Mirrorpoint
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelpoint
- Perpendicular
- Perpendicularpoint
- Point
- Polygon
- Reflection
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Tangent
- Text
- Ticks
- Tracecurve

## Classes

- _global_
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.C
- JXG.CanvasRenderer
- JXG.Circle
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.Curve
- JXG.Dump
- 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.Point
- JXG.Polygon
- JXG.Server
- JXG.Server.modules
- JXG.SVGRenderer
- JXG.Text
- JXG.Ticks
- JXG.Turtle
- JXG.Util
- JXG.VMLRenderer

# Built-In Namespace _global_

↳ _global_

Field Summary
Field Attributes | Field Name and Description
--- | ---
<deprecated> | circumcenterMidpoint
| o Special treatment of labels
| ret

Method Summary
Method Attributes | Method Name and Description
--- | ---
| affineDistance(array1, array2) Calculates euclidean distance for two given arrays of the same length.
<deprecated> | angle(A, B, C) Calculates the angle defined by the points A, B, C.
| angleBisector(A, B, C, board) Calculates the bisection between the three points A, B, C.
| calcStraight(el, point1, point2) A line can be a segment, a straight, or a ray.
| circumcenter(point1, point2, point3, board) Calculates the center of the circumcircle of the three given points.
| deg()
| distance(array1, array2) Calculates euclidean norm for two given arrays of the same length.
| f()
| fct(x, suspendedUpdate)
| findSplit(pts, i, j) findSplit() is a subroutine of JXG.Math.Numerics#RamerDouglasPeuker.
| intersectCircleCircle(circle1, circle2, board) Calculates the coordinates of the intersection of the given circles.
| intersectCircleLine(circle, line, board) Calculates the coordinates of the intersection of the given line and circle.
| intersectLineLine(line1, line2, board) Calculates the coordinates of the intersection of the given lines.
| isSameDir(p1, p2, i1, i2) The vectors p2-p1 and i2-i1 are supposed collinear.
| isSameDirection(start, p, s) If you're looking from point "start" towards point "s" and can see the point "p", true is returned.
| li()
| majorAxis()
| makeFct(which)
| meet(el1, el2, i, board) Computes the intersection of a pair of lines, circles or both.
| meetCircleCircle(circ1, circ2, i, board) Intersection of two circles using the stdform.
| meetCurveCurve(c1, c2, t1ini, t2ini, board) Compute an intersection of the curves c1 and c2 with a generalized Newton method.
| meetCurveLine(el1, el2, nr, board) order of input does not matter for el1 and el2.
| meetLineCircle(lin, circ, i, board) Intersection of line and circle using the stdform.
| meetLineLine(l1, l2, i, board) Intersection of two lines using the stdform.
| perpendicular(line, point, board) Calculates the coordinates of a point on the perpendicular to the given line through the given point.
| projectCoordsToCurve(x, y, t, curve, board) Calculates the coordinates of the projection of a coordinates pair on a given curve.
| projectPointToCircle(point, circle, board) Calculates the coordinates of the projection of a given point on a given circle.
| projectPointToCurve(point, curve, board) Calculates the coordinates of the projection of a given point on a given curve.
| projectPointToLine(point, line, board) Calculates the coordinates of the orthogonal projection of a given point on a given line.
| projectPointToPoint(point, dest, board) Trivial projection of a point to another point.
| projectPointToTurtle(point, turtle, board) Calculates the coordinates of the projection of a given point on a given turtle.
| rad(A, B, C) Calculates the internal angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.
<private> | RDP(pts, i, j, eps, newPts) RDP() is a private subroutine of JXG.Math.Numerics#RamerDouglasPeuker.
| reflection(line, point, board) Reflects the point along the line.
| rotation(rotpoint, point, phi, board) Computes the new position of a point which is rotated around a second point (called rotpoint) by the angle phi.
| stepFun(i)
| trueAngle(A, B, C) Calculates the angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.

Field Detail
circumcenterMidpoint
Defined in: MathGeometry.js.

Deprecated:
Please use JXG.Math.Geometry#circumcenter instead.

o
Special treatment of labels
Defined in: JXG.js.

ret
Defined in: JessieCode.js.
Method Detail
{Number} affineDistance(array1, array2)
Calculates euclidean distance for two given arrays of the same length. If one of the arrays contains a zero in the first coordinate, and the euclidean distance is different from zero it is a point at infinity and we return Infinity.
Defined in: MathGeometry.js.

Parameters:
{Array} array1
  Array containing elements of number.
{Array} array2
  Array containing elements of type number.

Returns:
  {Number} Euclidean (affine) distance of the given vectors.

{Number} angle(A, B, C)
Calculates the angle defined by the points A, B, C.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} A
  A point or [x,y] array.
{JXG.Point} B
  Another point or [x,y] array.
{JXG.Point} C
  A circle - no, of course the third point or [x,y] array.

Deprecated:
Use JXG.Math.Geometry#rad instead.

Returns:
  {Number} The angle in radian measure.

See:
  #rad
  #trueAngle

{JXG.Coords} angleBisector(A, B, C, board)
Calculates the bisection between the three points A, B, C. The bisection is defined by two points: Parameter B and a point with the coordinates calculated in this function.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} A
  Point
{JXG.Point} B
  Point
{JXG.Point} C
  Point
board Optional, Default: A.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the second point defining the bisection.

calcStraight(el, point1, point2)
A line can be a segment, a straight, or a ray. so it is not always delimited by point1 and point2 calcStraight determines the visual start point and end point of the line. A segment is only drawn from start to end point, a straight line is drawn until it meets the boards boundaries.
Defined in: MathGeometry.js.

Parameters:
{JXG.Line} el
  Reference to a line object, that needs calculation of start and end point.
{JXG.Coords} point1
  Coordinates of the point where line drawing begins. This value is calculated and set by this method.
{JXG.Coords} point2
  Coordinates of the point where line drawing ends. This value is calculated and set by this method.

See:
  Line
  JXG.Line

{JXG.Coords} circumcenter(point1, point2, point3, board)
Calculates the center of the circumcircle of the three given points.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} point1
  Point
{JXG.Point} point2
  Point
{JXG.Point} point3
  Point
{JXG.Board} board Optional, Default: point1.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the center of the circumcircle of the given points.

deg()
Defined in: MathNumerics.js.

{Number} distance(array1, array2)
Calculates euclidean norm for two given arrays of the same length.
Defined in: MathGeometry.js.

Parameters:
{Array} array1
  Array of float or integer.
{Array} array2
  Array of float or integer.

Returns:
  {Number} Euclidean distance of the given vectors.

f()
Defined in: JXG.js.

fct(x, suspendedUpdate)
Defined in: MathNumerics.js.

Parameters:
x
suspendedUpdate

findSplit(pts, i, j)
findSplit() is a subroutine of JXG.Math.Numerics#RamerDouglasPeuker. It searches for the point between index i and j which has the largest distance from the line between the points i and j.
Defined in: MathNumerics.js.

Parameters:
{Array} pts
  Array of JXG.Coords
{Number} i
  Index of a point in pts
{Number} j
  Index of a point in pts

{Array} intersectCircleCircle(circle1, circle2, board)
Calculates the coordinates of the intersection of the given circles.
Defined in: MathGeometry.js.

Parameters:
{JXG.Circle} circle1
  Circle.
{JXG.Circle} circle2
  Circle.
{JXG.Board} board Optional, Default: circle1.board
  Reference to the board

Returns:
  {Array} Coordinates of the intersection points of the given circles and the amount of intersection points in the first component of the array.

{Array} intersectCircleLine(circle, line, board)
Calculates the coordinates of the intersection of the given line and circle.
Defined in: MathGeometry.js.

Parameters:
{JXG.Circle} circle
  Circle.
{JXG.Line} line
  Line.
{JXG.Board} board Optional, Default: line.board
  Reference to the board

Returns:
  {Array} The coordinates of the intersection points of the given circle with the given line and the amount of intersection points in the first component of the array.

{JXG.Coords} intersectLineLine(line1, line2, board)
Calculates the coordinates of the intersection of the given lines.
Defined in: MathGeometry.js.

Parameters:
{JXG.Line} line1
  Line.
{JXG.Line} line2
  Line.
{JXG.Board} board Optional, Default: line1.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the intersection point of the given lines.

{Boolean} isSameDir(p1, p2, i1, i2)
The vectors p2-p1 and i2-i1 are supposed collinear. If their cosine is positive they point into the same direction otherwise they point in opposite direction
Defined in: MathGeometry.js.

Parameters:
{JXG.Coords} p1
{JXG.Coords} p2
{JXG.Coords} i1
{JXG.Coords} i2

Returns:
  {Boolean} True, if p2-p1 and i2-i1 point into the same direction

{Boolean} isSameDirection(start, p, s)
If you're looking from point "start" towards point "s" and can see the point "p", true is returned. Otherwise false.
Defined in: MathGeometry.js.

Parameters:
{JXG.Coords} start
  The point you're standing on.
{JXG.Coords} p
  The point in which direction you're looking.
{JXG.Coords} s
  The point that should be visible.

Returns:
  {Boolean} True, if from start the point p is in the same direction as s is, that means s-start = k*(p-start) with k>=0.

li()
Defined in: Composition.js.

majorAxis()
Defined in: Conic.js.

makeFct(which)
Defined in: MathNumerics.js.

Parameters:
which

{JXG.Coords} meet(el1, el2, i, board)
Computes the intersection of a pair of lines, circles or both. It uses the internal data array stdform of these elements.
Defined in: MathGeometry.js.

Parameters:
{Array} el1
  stdform of the first element (line or circle)
{Array} el2
  stdform of the second element (line or circle)
{Number} i
  Index of the intersection point that should be returned.
board
  Reference to the board.

Returns:
  {JXG.Coords} Coordinates of one of the possible two or more intersection points. Which point will be returned is determined by i.

{JXG.Coords} meetCircleCircle(circ1, circ2, i, board)
Intersection of two circles using the stdform.
Defined in: MathGeometry.js.

Parameters:
{Array} circ1
  stdform of the first circle
{Array} circ2
  stdform of the second circle
{number} i
  number of the returned intersection point. i==0: use the positive square root, i==1: use the negative square root.
{JXG.Board} board
  Reference to the board.

Returns:
  {JXG.Coords} Coordinates of the intersection point

{JXG.Coords} meetCurveCurve(c1, c2, t1ini, t2ini, board)
Compute an intersection of the curves c1 and c2 with a generalized Newton method. We want to find values t1, t2 such that c1(t1) = c2(t2), i.e. (c1_x(t1)-c2_x(t2),c1_y(t1)-c2_y(t2)) = (0,0). We set (e,f) := (c1_x(t1)-c2_x(t2),c1_y(t1)-c2_y(t2)) The Jacobian J is defined by J = (a, b) (c, d) where a = c1_x'(t1) b = -c2_x'(t2) c = c1_y'(t1) d = -c2_y'(t2) The inverse J^(-1) of J is equal to (d, -b)/ (-c, a) / (ad-bc) Then, (t1new, t2new) := (t1,t2) - J^(-1)*(e,f). If the function meetCurveCurve possesses the properties t1memo and t2memo then these are taken as start values for the Newton algorithm. After stopping of the Newton algorithm the values of t1 and t2 are stored in t1memo and t2memo.
Defined in: MathGeometry.js.

Parameters:
{JXG.Curve} c1
  Curve, Line or Circle
{JXG.Curve} c2
  Curve, Line or Circle
{Number} t1ini
  start value for t1
{Number} t2ini
  start value for t2
{JXG.Board} board Optional, Default: c1.board
  Reference to a board object.

Returns:
  {JXG.Coords} intersection point

{JXG.Coords} meetCurveLine(el1, el2, nr, board)
order of input does not matter for el1 and el2.
Defined in: MathGeometry.js.

Parameters:
{JXG.Curve|JXG.Line} el1
  Curve or Line
{JXG.Curve|JXG.Line} el2
  Curve or Line
{?} nr
{JXG.Board} board Optional, Default: el1.board
  Reference to a board object.

Returns:
  {JXG.Coords} Intersection point

{JXG.Coords} meetLineCircle(lin, circ, i, board)
Intersection of line and circle using the stdform.
Defined in: MathGeometry.js.

Parameters:
{Array} lin
  stdform of the line
{Array} circ
  stdform of the circle
{number} i
  number of the returned intersection point. i==0: use the positive square root, i==1: use the negative square root.
{JXG.Board} board
  Reference to a board.

Returns:
  {JXG.Coords} Coordinates of the intersection point

{JXG.Coords} meetLineLine(l1, l2, i, board)
Intersection of two lines using the stdform.
Defined in: MathGeometry.js.

Parameters:
{Array} l1
  stdform of the first line
{Array} l2
  stdform of the second line
{number} i
  unused
{JXG.Board} board
  Reference to the board.

Returns:
  {JXG.Coords} Coordinates of the intersection point.

{JXG.Coords} perpendicular(line, point, board)
Calculates the coordinates of a point on the perpendicular to the given line through the given point.
Defined in: MathGeometry.js.

Parameters:
{JXG.Line} line
  A line.
{JXG.Point} point
  Intersection point of line to perpendicular.
{JXG.Board} board Optional, Default: point.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of a point on the perpendicular to the given line through the given point.

{JXG.Coords} projectCoordsToCurve(x, y, t, curve, board)
Calculates the coordinates of the projection of a coordinates pair on a given curve. In case of function graphs this is the intersection point of the curve and the parallel to y-axis through the given point.
Defined in: MathGeometry.js.

Parameters:
{Number} x
  coordinate to project.
{Number} y
  coordinate to project.
{Number} t
  start value for newtons method
{JXG.Curve} curve
  Curve on that the point is projected.
{JXG.Board} board Optional, Default: curve.board
  Reference to a board.

Returns:
  {JXG.Coords} Array containing the coordinates of the projection of the given point on the given graph and the position on the curve.

See:
  #projectPointToCurve

{JXG.Coords} projectPointToCircle(point, circle, board)
Calculates the coordinates of the projection of a given point on a given circle. I.o.w. the nearest one of the two intersection points of the line through the given point and the circles center.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} point
  Point to project.
{JXG.Circle} circle
  Circle on that the point is projected.
{JXG.Board} board Optional, Default: point.board
  Reference to the board

Returns:
  {JXG.Coords} The coordinates of the projection of the given point on the given circle.

{JXG.Coords} projectPointToCurve(point, curve, board)
Calculates the coordinates of the projection of a given point on a given curve. Uses #projectCoordsToCurve.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} point
  Point to project.
{JXG.Curve} curve
  Curve on that the point is projected.
{JXG.Board} board Optional, Default: point.board
  Reference to a board.

Returns:
  {JXG.Coords} The coordinates of the projection of the given point on the given graph.

See:
  #projectCoordsToCurve

{JXG.Coords} projectPointToLine(point, line, board)
Calculates the coordinates of the orthogonal projection of a given point on a given line. I.o.w. the intersection point of the given line and its perpendicular through the given point.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} point
  Point to project.
{JXG.Line} line
  Line on that the point is projected.
{JXG.Board} board Optional, Default: point.board
  Reference to a board.

Returns:
  {JXG.Coords} The coordinates of the projection of the given point on the given line.

{JXG.Coords} projectPointToPoint(point, dest, board)
Trivial projection of a point to another point.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} point
  Point to project (not used).
{JXG.Point} dest
  Point on that the point is projected.
{JXG.Board} board Optional, Default: point.board
  Reference to the board (not used).

Returns:
  {JXG.Coords} The coordinates of the projection of the given point on the given circle.

{JXG.Coords} projectPointToTurtle(point, turtle, board)
Calculates the coordinates of the projection of a given point on a given turtle. A turtle consists of one or more curves of curveType 'plot'. Uses #projectPointToCurve.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} point
  Point to project.
{JXG.Turtle} turtle
  on that the point is projected.
{JXG.Board} board Optional, Default: point.board
  Reference to a board.

Returns:
  {JXG.Coords} The coordinates of the projection of the given point on the given turtle.

{Number} rad(A, B, C)
Calculates the internal angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} A
  Point or [x,y] array
{JXG.Point} B
  Point or [x,y] array
{JXG.Point} C
  Point or [x,y] array

Returns:
  {Number} Angle in radians.

See:
  #trueAngle

<private> RDP(pts, i, j, eps, newPts)
RDP() is a private subroutine of JXG.Math.Numerics#RamerDouglasPeuker. It runs recursively through the point set and searches the point which has the largest distance from the line between the first point and the last point. If the distance from the line is greater than eps, this point is included in our new point set otherwise it is discarded. If it is taken, we recursively apply the subroutine to the point set before and after the chosen point.
Defined in: MathNumerics.js.

Parameters:
{Array} pts
  Array of JXG.Coords
{Number} i
  Index of an element of pts
{Number} j
  Index of an element of pts
{Number} eps
  If the absolute value of a given number `x` is smaller than `eps` it is considered to be equal `0`.
{Array} newPts
  Array of JXG.Coords

{JXG.Coords} reflection(line, point, board)
Reflects the point along the line.
Defined in: MathGeometry.js.

Parameters:
{JXG.Line} line
  Axis of reflection.
{JXG.Point} point
  Point to reflect.
board Optional, Default: point.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the reflected point.

{JXG.Coords} rotation(rotpoint, point, phi, board)
Computes the new position of a point which is rotated around a second point (called rotpoint) by the angle phi.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} rotpoint
  Center of the rotation
{JXG.Point} point
  point to be rotated
{number} phi
  rotation angle in arc length
{JXG.Board} board Optional, Default: point.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the new position.

stepFun(i)
Defined in: Point.js.

Parameters:
i

{Number} trueAngle(A, B, C)
Calculates the angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.
Defined in: MathGeometry.js.

Parameters:
{JXG.Point} A
  Point or [x,y] array
{JXG.Point} B
  Point or [x,y] array
{JXG.Point} C
  Point or [x,y] array

Returns:
  {Number} The angle in degrees.

See:
  #rad

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Apr 02 2012 17:53:57 GMT+0200 (MESZ)