# 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.Circle

JXG.GeometryElement
↳ JXG.Circle

Creates a new circle object. Do not use this constructor to create a circle. Use JXG.Board#create with type Circle instead.
Defined in: Circle.js.
Extends JXG.GeometryElement.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.Circle(board, method, p1, p2, radius, id, name) A circle consists of all points with a given distance from one point.

Fields borrowed from class JXG.GeometryElement:
  addEvent, ancestors, baseElement, board, childElements, dash, descendants, draft, dump, elementClass, elType, eventHandlers, fillColor, fillOpacity, fixed, frozen, getAttribute, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isDraggable, isReal, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, type, visible, visProp, withLabel

Field Summary
Field Attributes | Field Name and Description
--- | ---
| center The circles center.
| circle Circle defining the radius of the circle given by the radius of the other circle only set if method equals 'pointLine'.
| line Line defining the radius of the circle given by the distance from the startpoint and the endpoint of the line only set if method equals 'pointLine'.
| method Stores the given method.
| point2 Point on the circle only set if method equals 'twoPoints'.
| radius Radius of the circle only set if method equals 'pointRadius'

Fields borrowed from class JXG.GeometryElement:
  addEvent, ancestors, baseElement, board, childElements, dash, descendants, draft, dump, elementClass, elType, eventHandlers, fillColor, fillOpacity, fixed, frozen, getAttribute, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isDraggable, isReal, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, removeEvent, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, trace, traceAttributes, traces, transformations, type, visible, visProp, withLabel

Method Summary
Method Attributes | Method Name and Description
--- | ---
| addTransform(transform) Add transformations to this circle.
<private> | generatePolynomial(p) Used to generate a polynomial for a point p that lies on this circle.
<private> | generateRadiusSquared() Generate symbolic radius calculation for loci determination with Groebner-Basis algorithm.
<private> | generateTerm(term) TODO description
| getRadius()
<private> | hasPoint(x, y) Checks whether (x,y) is near the circle.
<private> | maxX() TODO description
<private> | minX() TODO description
<private> | notifyParents(contentStr) TODO description
| Radius() Calculates the radius of the circle.
<private> | setPosition(method, x, y) TODO description
| setPositionDirectly(method, x, y, oldx, oldy) Sets x and y coordinate and calls the circle's update() method.
| setRadius(r) Set a new radius, then update the board.
| update() Uses the boards renderer to update the circle.
<private> | updateQuadraticform() TODO description
<private> | updateRenderer() Uses the boards renderer to update the circle.
<private> | updateStdform() TODO description
| X(t) Treats the circle as parametric curve and calculates its X coordinate.
| Y(t) Treats the circle as parametric curve and calculates its Y coordinate.
| Z(t) Treat the circle as parametric curve and calculates its Z coordinate.

Methods borrowed from class JXG.GeometryElement:
  _set, addChild, addDescendants, animate, bounds, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, getAttributes, getLabelAnchor, getName, getParents, getProperty, getTextAnchor, getType, hideElement, labelColor, noHighlight, normalize, off, on, prepareUpdate, remove, resolveShortcuts, setArrow, setAttribute, setDash, setLabelText, setProperty, setStraight, showElement, triggerEventHandlers

Class Detail
JXG.Circle(board, method, p1, p2, radius, id, name)
A circle consists of all points with a given distance from one point. This point is called center, the distance is called radius. A circle can be constructed by providing a center and a point on the circle or a center and a radius (given as a number, function, line, or circle).

Parameters:
{String|JXG.Board} board
  The board the new circle is drawn on.
{String} method
  Can be
  - 'twoPoints' which means the circle is defined by its center and a point on the circle.
  - 'pointRadius' which means the circle is defined by its center and its radius in user units
  - 'pointLine' which means the circle is defined by its center and its radius given by the distance from the startpoint and the endpoint of the line
  - 'pointCircle' which means the circle is defined by its center and its radius given by the radius of another circle
  The parameters p1, p2 and radius must be set according to this method parameter.
{JXG.Point} p1
  center of the circle.
{JXG.Point|JXG.Line|JXG.Circle} p2
  Can be
  - a point on the circle if method is 'twoPoints'
  - a line if the method is 'pointLine'
  - a circle if the method is 'pointCircle'
{float} radius
  Only used when method is set to 'pointRadius'. Must be a given radius in user units.
{String} id
  Unique identifier for this object. If null or an empty string is given, an unique id will be generated by Board
{String} name
  Not necessarily unique name. If null or an empty string is given, an unique name will be generated.

See:
  JXG.Board#generateName

Field Detail
{JXG.Point} center
The circles center. Do not set this parameter directly as it will break JSXGraph's update system.

{JXG.Circle} circle
Circle defining the radius of the circle given by the radius of the other circle only set if method equals 'pointLine'. Do not set this parameter directly as it will break JSXGraph's update system.

See:
  #method

Default Value:
  null

{JXG.Line} line
Line defining the radius of the circle given by the distance from the startpoint and the endpoint of the line only set if method equals 'pointLine'. Do not set this parameter directly as it will break JSXGraph's update system.

See:
  #method

Default Value:
  null

{string} method
Stores the given method. Can be

- 'twoPoints' which means the circle is defined by its center and a point on the circle.
- 'pointRadius' which means the circle is defined by its center and its radius given in user units or as term.
- 'pointLine' which means the circle is defined by its center and its radius given by the distance from the startpoint and the endpoint of the line.
- 'pointCircle' which means the circle is defined by its center and its radius given by the radius of another circle.

See:
  #center
  #point2
  #radius
  #line
  #circle

{JXG.Point} point2
Point on the circle only set if method equals 'twoPoints'. Do not set this parameter directly as it will break JSXGraph's update system.

See:
  #method

{JXG.Point} radius
Radius of the circle only set if method equals 'pointRadius'

See:
  #method

Default Value:
  null

Method Detail
{JXG.Circle} addTransform(transform)
Add transformations to this circle.

Parameters:
{JXG.Transform|Array} transform
  Either one JXG.Transform or an array of JXG.Transforms.

Returns:
  {JXG.Circle} Reference to this circle object.

<private> generatePolynomial(p)
Used to generate a polynomial for a point p that lies on this circle.

Parameters:
p
  The point for that the polynomial is generated.

Returns:
  An array containing the generated polynomial.

<private> {String} generateRadiusSquared()
Generate symbolic radius calculation for loci determination with Groebner-Basis algorithm.

Returns:
  String containing symbolic calculation of the circle's radius or an empty string if the radius can't be expressed in a polynomial equation.

<private> generateTerm(term)
TODO description

Parameters:
term
  TODO type & description

getRadius()

<private> {bool} hasPoint(x, y)
Checks whether (x,y) is near the circle.

Parameters:
{int} x
  Coordinate in x direction, screen coordinates.
{int} y
  Coordinate in y direction, screen coordinates.

Returns:
  {bool} True if (x,y) is near the circle, False otherwise.

<private> maxX()
TODO description

<private> minX()
TODO description

<private> notifyParents(contentStr)
TODO description

Parameters:
contentStr
  TODO type&description

{float} Radius()
Calculates the radius of the circle.

Returns:
  The radius of the circle

<private> setPosition(method, x, y)
TODO description

Parameters:
method
  TODO
x
  TODO
y
  TODO

{JXG.Circle} setPositionDirectly(method, x, y, oldx, oldy)
Sets x and y coordinate and calls the circle's update() method.

Parameters:
{number} method
  The type of coordinates used here. Possible values are JXG.COORDS_BY_USER and JXG.COORDS_BY_SCREEN.
{Number} x
  x coordinate in screen/user units
{Number} y
  y coordinate in screen/user units
{Number} oldx
  previous x coordinate in screen/user units
{Number} oldy
  previous y coordinate in screen/user units

Returns:
  {JXG.Circle} Reference to this circle.

{JXG.Circle} setRadius(r)
Set a new radius, then update the board.

Parameters:
{String|Number|function} r
  A string, function or number describing the new radius.

Returns:
  {JXG.Circle} Reference to this circle

update()
Uses the boards renderer to update the circle.

<private> updateQuadraticform()
TODO description

<private> updateRenderer()
Uses the boards renderer to update the circle.

<private> updateStdform()
TODO description

{Number} X(t)
Treats the circle as parametric curve and calculates its X coordinate.

Parameters:
{Number} t
  Number between 0 and 1.

Returns:
  {Number} `X(t)= radius*cos(t)+centerX`.

{Number} Y(t)
Treats the circle as parametric curve and calculates its Y coordinate.

Parameters:
{Number} t
  Number between 0 and 1.

Returns:
  {Number} `X(t)= radius*sin(t)+centerY`.

{Number} Z(t)
Treat the circle as parametric curve and calculates its Z coordinate.

Parameters:
{Number} t
  ignored

Returns:
  {Number} 1.0

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