# JSXGraph 1.11.1 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
- Axes3D
- Axis
- Axis3D
- Bisector
- Bisectorlines
- Boxplot
- Button
- Cardinalspline
- Chart
- Checkbox
- Circle
- Circle3D
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Comb
- Conic
- Curve
- Curve3D
- CurveDifference
- CurveIntersection
- CurveUnion
- Derivative
- Ellipse
- Face3D
- ForeignObject
- Functiongraph
- Functiongraph3D
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- ImplicitCurve
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- IntersectionCircle3D
- IntersectionLine3D
- Label
- Legend
- Line
- Line3D
- MajorArc
- MajorSector
- Measurement
- Mesh3D
- Metapostspline
- Midpoint
- MinorArc
- MinorSector
- MirrorElement
- MirrorPoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelogram
- Parallelpoint
- ParametricSurface3D
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Plane3D
- Point
- Point3D
- PolarLine
- PolePoint
- Polygon
- Polygon3D
- PolygonalChain
- Polyhedron3D
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopefield
- Slopetriangle
- Smartlabel
- Sphere3D
- Spline
- Stepfunction
- Tangent
- TangentTo
- Tapemeasure
- Text
- Text3D
- Ticks
- Ticks3D
- Tracecurve
- Transformation
- Transformation3D
- Turtle
- Vectorfield
- Vectorfield3D
- View3D

Classes

- _global_
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.Board.infobox
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Chart
- JXG.Circle
- JXG.Circle3D
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Curve3D
- JXG.Dump
- JXG.EventEmitter
- JXG.Expect
- JXG.Face3D
- JXG.ForeignObject
- JXG.GeometryElement
- JXG.GeometryElement3D
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Legend
- JXG.Line
- JXG.Line3D
- JXG.Math
- JXG.Math.BoxQuadtree
- JXG.Math.Clip
- JXG.Math.Extrapolate
- JXG.Math.Geometry
- JXG.Math.ImplicitPlot
- JXG.Math.IntervalArithmetic
- JXG.Math.Metapost
- JXG.Math.Nlp
- JXG.Math.Numerics
- JXG.Math.Plot
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.ProbFuncs
- JXG.Math.Quadtree
- JXG.Math.Statistics
- JXG.NoRenderer
- JXG.Options
- JXG.Plane3D
- JXG.Point
- JXG.Point3D
- JXG.Polygon
- JXG.Polygon3D
- JXG.PrefixParser
- JXG.Sphere3D
- JXG.Surface3D
- JXG.SVGRenderer
- JXG.Text
- JXG.Text3D
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.View3D
- JXG.VMLRenderer
- JXG.XML

# Element Line3D

JXG.GeometryElement
↳ JXG.GeometryElement3D
↳ Line3D

A line in 3D is given by two points, or one point and a direction vector.
Defined in: linspace3d.js.
Extends JXG.GeometryElement3D.

Element Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| Line3D A line in 3D is given by two points, or one point and a direction vector.

Attributes Summary
Field Attributes | Field Name and Description
--- | ---
| point Attributes of the defining point in case the line is defined by [point, vector, [range]]
| point1 Attributes of the first point in case the line is defined by [point, point].
| point2 Attributes of the second point in case the line is defined by [point, point].
| straightFirst If the 3D line is defined by two points and if this attribute is true, the 3D line stretches infinitely in direction of its first point.
| straightLast If the 3D line is defined by two points and if this attribute is true, the 3D line stretches infinitely in direction of its second point.

Field Summary
Field Attributes | Field Name and Description
--- | ---
| direction Direction which - together with a point - defines the line.
| endpoints Array of length 2 containing the endings of the Line3D element.
<private> | getPointCoords Determine one end point of a 3D line from point, direction and range).
<static> | Line3D.point 3D point which - together with a direction - defines the line.
| range Range [r1, r2] of the line.
| vec Spanning vector of the 3D line.

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> | setPosition2D(t) Set the 2D position of the defining points.
<private> | updateCoords() Update the array Line3D#vec containing the homogeneous coords of the spanning vector.
| updateZIndex() Update the z-index of the line, i.e.

Methods borrowed from class JXG.GeometryElement:
  _set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, eval, evalVisProp, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, hasPoint, hide, hideElement, noHighlight, normalize, prepareUpdate, remove, removeAllTicks, removeChild, removeDescendants, removeTicks, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setPositionDirectly, setProperty, show, showElement, snapToPoints, update, updateRenderer, updateVisibility, useLocale

Events borrowed from class JXG.GeometryElement:
  attribute, attribute:key, down, drag, keydrag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, pendown, pendrag, penup, touchdown, touchdrag, touchup, up

Element Detail
Line3D
A line in 3D is given by two points, or one point and a direction vector. That is, there are the following two possibilities to create a Line3D object:

1. The 3D line is defined by two 3D points (Point3D): The points can be either existing points or coordinate arrays of the form [x, y, z].

   The 3D line is defined by a point (or coordinate array [x, y, z]) a direction given as array [x, y, z] and an optional range given as array [s, e]. The default value for the range is [-Infinity, Infinity].

All numbers can also be provided as functions returning a number. The case [point, array] is ambiguous, it is not clear if 'array' contains the coordinates of a point or of a direction. In that case, 'array' is interpreted as the coordinate array of a point, i.e. the line is defined by two points.

This element has no direct constructor. To create an instance of this element you have to call JXG.Board#create with type "line3d".
Possible parent array combinations are:
{JXG.Point3D|array|function} point1
{JXG.Point3D|array|function} point2
  First and second defining point of the line. The attributes Line3D#straightFirst and Line3D#straightLast control if the line is displayed as segment, ray or infinite line.
{JXG.Point3D|array|function} point
{JXG.Line3D|array|function} direction
{array|function} range
  The line is defined by point, direction and range.
  - point: Point3D or array of length 3
  - direction: array of length 3 or function returning an array of numbers or function returning an array
  - range: array of length 2, elements can also be functions. Use [-Infinity, Infinity] for infinite lines.

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

Examples:

        var bound = [-5, 5];
        var view = board.create('view3d',
            [[-6, -3], [8, 8],
            [bound, bound, bound]],
            {});
        var p = view.create('point3d', [1, 2, 2], { name:'A', size: 5 });
        // Lines through 2 points
        var l1 = view.create('line3d', [[1, 3, 3], [-3, -3, -3]], {point1: {visible: true}, point2: {visible: true} });
        var l2 = view.create('line3d', [p, l1.point1]);

        // Line by point, direction, range
        var l3 = view.create('line3d', [p, [0, 0, 1], [-2, 4]]);

        var view = board.create(
            'view3d',
            [[-6, -3], [8, 8],
            [[-3, 3], [-3, 3], [-3, 3]]],
            {
                depthOrder: {
                    enabled: true
                },
                projection: 'central',
                xPlaneRear: {fillOpacity: 0.2},
                yPlaneRear: {fillOpacity: 0.2},
                zPlaneRear: {fillOpacity: 0.2}
            }
        );

        var A = view.create('point3d', [0, 0, 0], {size: 2});
        var B = view.create('point3d', [2, 1, 1], {size: 2});
        var C = view.create('point3d', [-2.5, 2.5, 1.5], {size: 2});

        // Draggable line by two points
        var line1 = view.create('line3d', [A, B], {
            fixed: false,
            straightFirst: true,
            straightLast: true,
            dash: 2
        });

        // Line by point, direction, and range
        var line2 = view.create('line3d', [C, [1, 0, 0], [-1, Infinity]], {
            strokeColor: 'blue'
        });

        // Line by point and array
        var line3 = view.create('line3d', [C, [-2.5, -1, 1.5]], {
            point2: { visible: true},
            strokeColor: 'red'
        });

     var view = board.create(
         'view3d',
         [[-6, -3], [8, 8],
         [[-3, 3], [-3, 3], [-3, 3]]],
         {
             depthOrder: {
                 enabled: true
             },
             projection: 'parallel',
             xPlaneRear: { fillOpacity: 0.2 },
             yPlaneRear: { fillOpacity: 0.2 },
             zPlaneRear: { fillOpacity: 0.2 }
         }
     );

    var A = view.create('point3d', [-2, 0, 1], { size: 2 });
    var B = view.create('point3d', [-2, 0, 2], { size: 2 });
    var line1 = view.create('line3d', [A, B], {
        fixed: false,
        strokeColor: 'blue',
        straightFirst: true,
        straightLast: true
    });

    var C = view.create('point3d', [2, 0, 1], { size: 2 });
    var line2 = view.create('line3d', [C, line1, [-Infinity, Infinity]], { strokeColor: 'red' });

Attribute Detail
{Point3D} point
Attributes of the defining point in case the line is defined by [point, vector, [range]]
Defined in: options3d.js.

Default Value:

      visible: false, name: ""

{Point3D} point1
Attributes of the first point in case the line is defined by [point, point].
Defined in: options3d.js.

Default Value:

      visible: false, name: ""

{Point3D} point2
Attributes of the second point in case the line is defined by [point, point].
Defined in: options3d.js.

Default Value:

      visible: false, name: ""

{Boolean} straightFirst
If the 3D line is defined by two points and if this attribute is true, the 3D line stretches infinitely in direction of its first point. Otherwise it ends at point1.
Defined in: options3d.js.

See:
  Line3D#straightLast

Default Value:
  false

{Boolean} straightLast
If the 3D line is defined by two points and if this attribute is true, the 3D line stretches infinitely in direction of its second point. Otherwise it ends at point2.
Defined in: options3d.js.

See:
  Line3D#straightFirst

Default Value:
  false

Field Detail
{Array|Function} direction
Direction which - together with a point - defines the line. Array of numbers or functions (of length 3) or function returning array of length 3.

See:
  Line3D.point

endpoints
Array of length 2 containing the endings of the Line3D element. These are the defining points, the intersections of the line with the bounding box, or the endings defined by the range.

<private> {Array} getPointCoords
Determine one end point of a 3D line from point, direction and range).

<static> {Point3D} Line3D.point
3D point which - together with a direction - defines the line.

See:
  Line3D#direction

{Array} range
Range [r1, r2] of the line. r1, r2 can be numbers or functions. The 3D line goes from (point + r1 * direction) to (point + r2 * direction)

Default Value:
  [-Infinity, Infinity]

vec
Spanning vector of the 3D line. Contains the evaluated coordinates from direction and range. The array has length 4, the first entry being 0.
Method Detail
<private> setPosition2D(t)
Set the 2D position of the defining points.

Parameters:
{JXG.Transformation} t
  projective 2D transformation

<private> {Object} updateCoords()
Update the array Line3D#vec containing the homogeneous coords of the spanning vector.

Returns:
  {Object} Reference to Line3D object

{Object} updateZIndex()
Update the z-index of the line, i.e. the z-index of its midpoint.

Returns:
  {Object} Reference to Line3D object

Attributes borrowed from other Elements

Attributes borrowed from class JXG.GeometryElement:
  aria, cssClass, dash, dashScale, draft, dragToTopOfLayer, element3D, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, highlight, highlightCssClass, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, isLabel, layer, lineCap, needsRegularUpdate, nonnegativeOnly, precision, priv, rotatable, scalable, shadow, snapToGrid, strokeColor, strokeOpacity, strokeWidth, tabindex, trace, traceAttributes, transitionDuration, transitionProperties, visible, withLabel

Fields borrowed from other Elements

Fields borrowed from class JXG.GeometryElement3D:
  element2D, is3D, view
Fields borrowed from class JXG.GeometryElement:
  _org_type, _pos, ancestors, baseElement, board, childElements, descendants, dump, elementClass, elType, hasLabel, highlighted, id, inherits, isDraggable, isReal, lastDragTime, methodMap, mouseover, name, needsUpdate, notExistingParents, numTraces, parents, quadraticform, rendNode, stdform, subs, symbolic, traces, transformations, type, visProp, visPropCalc

Methods borrowed from other Elements

Methods borrowed from class JXG.GeometryElement:
  _set, addChild, addDescendants, addParents, addParentsFromJCFunctions, addRotation, addTicks, addTransform, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, eval, evalVisProp, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getParents, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, hasPoint, hide, hideElement, noHighlight, normalize, prepareUpdate, remove, removeAllTicks, removeChild, removeDescendants, removeTicks, resolveShortcuts, setArrow, setAttribute, setDash, setDisplayRendNode, setLabel, setLabelText, setName, setParents, setPosition, setPositionDirectly, setProperty, show, showElement, snapToPoints, update, updateRenderer, updateVisibility, useLocale

Events borrowed from other Elements

Events borrowed from class JXG.GeometryElement:
  attribute, attribute:key, down, drag, keydrag, mousedown, mousedrag, mousemove, mouseout, mouseover, mouseup, move, out, over, pendown, pendrag, penup, touchdown, touchdrag, touchup, up

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Apr 04 2025 09:22:41 GMT+0200 (Mitteleuropäische Sommerzeit)