# JSXGraph 1.7.0 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
- Boxplot
- Button
- Cardinalspline
- Chart
- Checkbox
- Circle
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Comb
- Conic
- Curve
- Curve3D
- CurveDifference
- CurveIntersection
- CurveUnion
- Derivative
- Ellipse
- ForeignObject
- Functiongraph
- Functiongraph3D
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- ImplicitCurve
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.Board.infobox
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Chart
- JXG.Circle
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Curve3D
- JXG.Dump
- JXG.EventEmitter
- JXG.Expect
- 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.Math.Symbolic
- JXG.NoRenderer
- JXG.Options
- JXG.Plane3D
- JXG.Point
- JXG.Point3D
- JXG.Polygon
- JXG.PrefixParser
- JXG.Server
- JXG.Server.modules
- JXG.Surface3D
- JXG.SVGRenderer
- JXG.Text
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.View3D
- JXG.VMLRenderer
- JXG.XML
- Label
- Legend
- Line
- Line3D
- Locus
- MajorArc
- MajorSector
- Measurement
- Metapostspline
- Midpoint
- MinorArc
- MinorSector
- mirrorelement
- Mirrorpoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelogram
- Parallelpoint
- ParametricSurface3D
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Point
- Point3D
- PolarLine
- PolePoint
- Polygon
- PolygonalChain
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopefield
- Slopetriangle
- Smartlabel
- Spline
- Stepfunction
- Tangent
- Tapemeasure
- Text
- Ticks
- Tracecurve
- Transformation
- Turtle
- Vectorfield
- Vectorfield3D
- View3D

# 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, par1, par2, attributes) A circle consists of all points with a given distance from one point.

Fields borrowed from class JXG.GeometryElement:
  _org_type, _pos, ancestors, baseElement, board, childElements, dash, dashScale, descendants, draft, dragToTopOfLayer, dump, elementClass, elType, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isLabel, isReal, lastDragTime, layer, lineCap, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, parents, precision, priv, quadraticform, rendNode, rotatable, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, tabindex, trace, traceAttributes, traces, transformations, transitionDuration, transitionProperties, type, viewport, visible, visProp, visPropCalc, 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:
  _org_type, _pos, ancestors, baseElement, board, childElements, dash, dashScale, descendants, draft, dragToTopOfLayer, dump, elementClass, elType, fillColor, fillOpacity, fixed, frozen, gradient, gradientAngle, gradientCX, gradientCY, gradientEndOffset, gradientFR, gradientFX, gradientFY, gradientR, gradientSecondColor, gradientSecondOpacity, gradientStartOffset, hasLabel, highlight, highlighted, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, inherits, isDraggable, isLabel, isReal, lastDragTime, layer, lineCap, methodMap, mouseover, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, parents, precision, priv, quadraticform, rendNode, rotatable, scalable, shadow, snapToGrid, stdform, strokeColor, strokeOpacity, strokeWidth, subs, symbolic, tabindex, trace, traceAttributes, traces, transformations, transitionDuration, transitionProperties, type, viewport, visible, visProp, visPropCalc, withLabel

Method Summary
Method Attributes | Method Name and Description
--- | ---
| addTransform(transform) Add transformations to this circle.
| Area() Circle area
| bounds() Get bounding box of the circle.
| Diameter() Calculates the diameter of the circle.
<private> | generateRadiusSquared() Generate symbolic radius calculation for loci determination with Groebner-Basis algorithm.
| getParents() Get data to construct this element.
| getRadius() Use JXG.Circle#Radius.
<private> | hasPoint(x, y) Checks whether (x,y) is near the circle line or inside of the ellipse (in case JXG.Options.conic#hasInnerPoints is true).
<private> | maxX() Returns 1.
<private> | minX() Returns 0.
<private> | notifyParents(contentStr) Finds dependencies in a given term and resolves them by adding the elements referenced in this string to the circle's list of ancestors.
| Perimeter() Perimeter (circumference) of circle.
| Radius(value) Calculates the radius of the circle.
| setRadius(r) Set a new radius, then update the board.
| update() Uses the boards renderer to update the circle.
<private> | updateQuadraticform() Updates this circle's JXG.Circle#quadraticform.
<private> | updateRenderer() Uses the boards renderer to update the circle.
<private> | updateStdform() Updates the stdform derived from the position of the center and the circle's radius.
| 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, addParents, addParentsFromJCFunctions, addRotation, addTicks, animate, clearTrace, cloneToBackground, countChildren, createGradient, createLabel, draggable, formatNumberLocale, fullUpdate, generatePolynomial, getAttribute, getAttributes, getLabelAnchor, getName, getProperty, getSnapSizes, getTextAnchor, getType, handleSnapToGrid, 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, 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

Class Detail
JXG.Circle(board, method, par1, par2, attributes)
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:
{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} par1
  center of the circle.
{JXG.Point|JXG.Line|JXG.Circle} par2
  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'
{Object} attributes

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

{Number} 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.Transformation|Array} transform
  Either one JXG.Transformation or an array of JXG.Transformations.

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

{Number} Area()
Circle area

Returns:
  {Number} area of the circle.

{Array} bounds()
Get bounding box of the circle.

Returns:
  {Array} [x1, y1, x2, y2]

{Number} Diameter()
Calculates the diameter of the circle.

Returns:
  {Number} The Diameter of the circle

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

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

{Array} getParents()
Get data to construct this element. Data consists of the parent elements and static data like radius.

Returns:
  {Array} data necessary to construct this element

getRadius()
Use JXG.Circle#Radius.

<private> {Boolean} hasPoint(x, y)
Checks whether (x,y) is near the circle line or inside of the ellipse (in case JXG.Options.conic#hasInnerPoints is true).

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

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

<private> maxX()
Returns 1.

<private> minX()
Returns 0.

<private> notifyParents(contentStr)
Finds dependencies in a given term and resolves them by adding the elements referenced in this string to the circle's list of ancestors.

Parameters:
{String} contentStr

{Number} Perimeter()
Perimeter (circumference) of circle.

Returns:
  {Number} Perimeter of circle in user units.

{Number} Radius(value)
Calculates the radius of the circle.

Parameters:
{String|Number|function} value Optional
  Set new radius

Returns:
  {Number} The radius of the 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()
Updates this circle's JXG.Circle#quadraticform.

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

<private> updateStdform()
Updates the stdform derived from the position of the center and the circle's radius.

{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 Wed Feb 14 2024 15:53:28 GMT+0100 (heure normale d’Europe centrale)