# 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

# Class JXG.Coords

↳ JXG.Coords

This is the Coordinates class. All members a coordinate has to provide are defined here.
Defined in: coords.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.Coords(method, coordinates, board, emitter) Constructs a new Coordinates object.

Field Summary
Field Attributes | Field Name and Description
--- | ---
| board Stores the board the object is used on.
| emitter If true, this coordinates object will emit update events every time the coordinates are set.
| scrCoords Stores coordinates for screen view as homogeneous coordinates.
| usrCoords Stores coordinates for user view as homogeneous coordinates.

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> | copy(obj, offset) Copy array, either scrCoords or usrCoords Uses slice() in case of standard arrays and set() in case of typed arrays.
| distance(coord_type, coordinates) Calculate distance of one point to another.
| isReal() Test if one of the usrCoords is NaN or the coordinates are infinite.
<private> | normalizeUsrCoords() Normalize homogeneous coordinates
<private> | screen2usr() Compute user coordinates out of given screen coordinates.
| setCoordinates(coord_type, coordinates, doRound, noevent) Set coordinates by either user coordinates or screen coordinates and recalculate the other one.
<private> | usr2screen(doRound) Compute screen coordinates out of given user coordinates.

Event Summary
Event Attributes | Event Name and Description
--- | ---
| update(ou, os) Triggered whenever the coordinates change.

Class Detail
JXG.Coords(method, coordinates, board, emitter)
Constructs a new Coordinates object.

Parameters:
{Number} method
  The type of coordinates given by the user. Accepted values are COORDS_BY_SCREEN and COORDS_BY_USER.
{Array} coordinates
  An array of affine coordinates.
{JXG.Board} board
  A reference to a board.
{Boolean} emitter Optional, Default: true

Field Detail
{JXG.Board} board
Stores the board the object is used on.

{boolean} emitter
If true, this coordinates object will emit update events every time the coordinates are set.

Default Value:
  true

{Array} scrCoords
Stores coordinates for screen view as homogeneous coordinates.

{Array} usrCoords
Stores coordinates for user view as homogeneous coordinates.
Method Detail
<private> {Array} copy(obj, offset)
Copy array, either scrCoords or usrCoords Uses slice() in case of standard arrays and set() in case of typed arrays.

Parameters:
{String} obj
  Either 'scrCoords' or 'usrCoords'
{Number} offset
  Offset, defaults to 0 if not given

Returns:
  {Array} Returns copy of the coords array either as standard array or as typed array.

{Number} distance(coord_type, coordinates)
Calculate distance of one point to another.

Parameters:
{Number} coord_type
  The type of coordinates used here. Possible values are JXG.COORDS_BY_USER and JXG.COORDS_BY_SCREEN.
{JXG.Coords} coordinates
  The Coords object to which the distance is calculated.

Returns:
  {Number} The distance

{Boolean} isReal()
Test if one of the usrCoords is NaN or the coordinates are infinite.

Returns:
  {Boolean} true if the coordinates are finite, false otherwise.

<private> normalizeUsrCoords()
Normalize homogeneous coordinates

<private> screen2usr()
Compute user coordinates out of given screen coordinates.

{JXG.Coords} setCoordinates(coord_type, coordinates, doRound, noevent)
Set coordinates by either user coordinates or screen coordinates and recalculate the other one.

Parameters:
{Number} coord_type
  The type of coordinates used here. Possible values are COORDS_BY_USER and COORDS_BY_SCREEN.
{Array} coordinates
  An array of affine coordinates the Coords object is set to.
{Boolean} doRound Optional, Default: true
  flag If true or null round the coordinates in usr2screen. This is used in smooth curve plotting. The IE needs rounded coordinates. Id doRound==false we have to round in updatePathString.
{Boolean} noevent Optional, Default: false

Returns:
  {JXG.Coords} Reference to the coords object.

<private> usr2screen(doRound)
Compute screen coordinates out of given user coordinates.

Parameters:
doRound

Event Detail
update(ou, os)
Triggered whenever the coordinates change.

Parameters:
{Array} ou
  Old user coordinates
{Array} os
  Old screen coordinates

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