# 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

# 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, renderer) Constructs a new Coordinates object.

Field Summary
Field Attributes | Field Name and Description
--- | ---
| board Stores the board the object is used on.
| 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
--- | ---
| distance(coord_type, coordinates) Calculate distance of one point to another.
<private> | normalizeUsrCoords() Normalize homogeneous coordinates
<private> | screen2usr() Compute user coordinates out of given screen coordinates.
| setCoordinates(coord_type, coordinates, doRound) 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.

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

Parameters:
{int} 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.AbstractRenderer} renderer
  A reference to a Renderer.

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

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

{Array} usrCoords
Stores coordinates for user view as homogeneous coordinates.
Method Detail
{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

<private> normalizeUsrCoords()
Normalize homogeneous coordinates

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

{JXG.Coords} setCoordinates(coord_type, coordinates, doRound)
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.

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

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

Parameters:
doRound

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