# 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
- Cardinalspline
- Checkbox
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Conic
- Curve
- Derivative
- 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
- Mirrorelement
- 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

# Class Line

JXG.GeometryElement
↳ JXG.Line
↳ Line

This element is used to provide a constructor for a general line. A general line is given by two points. By setting additional properties a line can be used as an arrow and/or axis.
Defined in: line.js.
Extends JXG.Line.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Line(point1,point2, c,a,b, f)

Fields borrowed from class JXG.Line:
  defaultTicks, parentPolygon
Fields borrowed from class JXG.GeometryElement:
  _org_type, _pos, ancestors, baseElement, board, childElements, dash, descendants, draft, dump, elementClass, elType, fillColor, fillOpacity, fixed, frozen, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, parents, quadraticform, rendNode, scalable, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, transitionDuration, type, visible, visProp, visPropCalc, withLabel

Field Summary
Field Attributes | Field Name and Description
--- | ---
| firstArrow Line has an arrow head at the position of its first point or the corresponding intersection with the canvas border.
| label Attributes for the line label.
| lastArrow Line has an arrow head at the position of its second point or the corresponding intersection with the canvas border.
| lineCap Line endings (linecap) of a straight line.
| point1 Attributes for first defining point of the line.
| point2 Attributes for second defining point of the line.
| snapSizeX Defines together with JXG.Point#snapSizeY the grid the point snaps on to.
| snapSizeY Defines together with JXG.Point#snapSizeX the grid the point snaps on to.
| snapToGrid If set to true, the point will snap to a grid defined by JXG.Point#snapSizeX and JXG.Point#snapSizeY.
| straightFirst If true, line stretches infinitely in direction of its first point.
| straightLast If true, line stretches infinitely in direction of its second point.
| ticks Attributes for ticks of the line.
| touchFirstPoint If set to true and Line#firstArrow is set to true, the arrow head will just touch the circle line of the start point of the line.
| touchLastPoint If set to true and Line#lastArrow is set to true, the arrow head will just touch the circle line of the start point of the line.

Fields borrowed from class JXG.Line:
  defaultTicks, parentPolygon
Fields borrowed from class JXG.GeometryElement:
  _org_type, _pos, ancestors, baseElement, board, childElements, dash, descendants, draft, dump, elementClass, elType, fillColor, fillOpacity, fixed, frozen, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, parents, quadraticform, rendNode, scalable, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, transitionDuration, type, visible, visProp, visPropCalc, withLabel

Methods borrowed from class JXG.Line:
  addTicks, addTransform, generatePolynomial, getAngle, getRise, getSlope, hasPoint, L, maxX, minX, removeAllTicks, removeTicks, setLabelRelativeCoords, setStraight, updateRenderer, updateSegmentFixedLength, updateStdform, X, Y, Z
Methods borrowed from class JXG.GeometryElement:
  _set, addChild, addDescendants, addParents, addRotation, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, fullUpdate, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getTextAnchor, getType, handleSnapToGrid, hideElement, labelColor, noHighlight, normalize, prepareUpdate, remove, removeChild, removeDescendants, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setPositionDirectly, setProperty, showElement, snapToPoints, update, updateVisibility

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
Line(point1,point2, c,a,b, f)

Parameters:
{JXG.Point|array|function_JXG.Point|array|function} point1,point2
  Parent elements can be two elements either of type JXG.Point or array of numbers describing the coordinates of a point. In the latter case the point will be constructed automatically as a fixed invisible point. It is possible to provide a function returning an array or a point, instead of providing an array or a point.
{Number|function_Number|function_Number|function} c,a,b
  A line can also be created providing three numbers. The line is then described by the set of solutions of the equation `a*x+b*y+c*z = 0`. It is possible to provide three functions returning numbers, too.
{function} f
  This function must return an array containing three numbers forming the line's homogeneous coordinates.

  Additionally, a line can be created by providing a line and a transformation (or an array of transformations). Then, the result is a line which is the transformation of the supplied line.

Throws:
{Exception}
  If the element cannot be constructed with the given parent objects an exception is thrown.

Examples:

    // Create a line using point and coordinates/
    // The second point will be fixed and invisible.
    var p1 = board.create('point', [4.5, 2.0]);
    var l1 = board.create('line', [p1, [1.0, 1.0]]);

    // Create a line using three coordinates
    var l1 = board.create('line', [1.0, -2.0, 3.0]);

            // Create a line (l2) as reflection of another line (l1)
            // reflection line
            var li = board.create('line', [1,1,1], {strokeColor: '#aaaaaa'});
            var reflect = board.create('transform', [li], {type: 'reflect'});

            var l1 = board.create('line', [1,-5,1]);
            var l2 = board.create('line', [l1, reflect]);

Field Detail
{Boolean / Object} firstArrow
Line has an arrow head at the position of its first point or the corresponding intersection with the canvas border.
Defined in: options.js.

See:
  Line#lastArrow
  Line#touchFirstPoint

Default Value:
  false

{Label} label
Attributes for the line label.
Defined in: options.js.

{Boolean / Object} lastArrow
Line has an arrow head at the position of its second point or the corresponding intersection with the canvas border.
Defined in: options.js.

See:
  Line#firstArrow
  Line#touchLastPoint

Default Value:
  false

lineCap
Line endings (linecap) of a straight line. Possible values are:

- 'butt',
- 'round',
- 'square'.

Not available for VML renderer. [lineCap description]
Defined in: options.js.

Default Value:
  'butt'

{Point} point1
Attributes for first defining point of the line.
Defined in: options.js.

{Point} point2
Attributes for second defining point of the line.
Defined in: options.js.

{Number} snapSizeX
Defines together with JXG.Point#snapSizeY the grid the point snaps on to. The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. If this value is equal to or less than `0`, it will use the grid displayed by the major ticks of the default ticks of the default x axes of the board.
Defined in: options.js.

See:
  Point#snapToGrid
  Point#snapSizeY
  JXG.Board#defaultAxes

Default Value:
  1

{Number} snapSizeY
Defines together with JXG.Point#snapSizeX the grid the point snaps on to. The point will only snap on integer multiples to snapSizeX in x and snapSizeY in y direction. If this value is equal to or less than `0`, it will use the grid displayed by the major ticks of the default ticks of the default y axes of the board.
Defined in: options.js.

See:
  Point#snapToGrid
  Point#snapSizeX
  Board#defaultAxes

Default Value:
  1

{Boolean} snapToGrid
If set to true, the point will snap to a grid defined by JXG.Point#snapSizeX and JXG.Point#snapSizeY.
Defined in: options.js.

See:
  Point#snapSizeX
  Point#snapSizeY

Default Value:
  false

{Boolean} straightFirst
If true, line stretches infinitely in direction of its first point. Otherwise it ends at point1.
Defined in: options.js.

See:
  Line#straightLast

Default Value:
  true

{Boolean} straightLast
If true, line stretches infinitely in direction of its second point. Otherwise it ends at point2.
Defined in: options.js.

See:
  Line#straightFirst

Default Value:
  true

{Ticks} ticks
Attributes for ticks of the line.
Defined in: options.js.

{Boolean} touchFirstPoint
If set to true and Line#firstArrow is set to true, the arrow head will just touch the circle line of the start point of the line.
Defined in: options.js.

See:
  Line#firstArrow

Default Value:
  false

{Boolean} touchLastPoint
If set to true and Line#lastArrow is set to true, the arrow head will just touch the circle line of the start point of the line.
Defined in: options.js.

See:
  Line#firstArrow

Default Value:
  false