JXG.Circle Class
Creates a new circle object. Do not use this constructor to create a circle. Use JXG.Board#create with type Circle instead.
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).
Constructor
JXG.Circle

board

method

par1

par2

attributes
Parameters:

board
JXG.BoardThe board the new circle is drawn on.

method
StringCan 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.

par1
JXG.Pointcenter of the circle.

par2
JXG.Point  JXG.Line  JXG.CircleCan be
 a point on the circle if method is 'twoPoints'
 a line if the method is 'pointLine'
 a circle if the method is 'pointCircle'

attributes
Object
See also:
Item Index
Methods
 _set
 addChild
 addDescendants
 addParents
 addRotation
 addTransform
 animate
 Area
 bounds
 clearTrace
 cloneToBackground
 countChildren
 createGradient
 createLabel
 dash deprecated
 draggable
 fillColor deprecated
 generatePolynomial
 generateRadiusSquared
 getAttribute
 getAttributes
 getLabelAnchor
 getName
 getParents
 getProperty deprecated
 getRadius deprecated
 getTextAnchor
 getTpye
 handleSnapToGrid
 hasPoint
 hideElement
 highlight
 highlightFillColor deprecated
 highlightStrokeColor deprecated
 labelColor deprecated
 maxX
 minX
 noHighlight
 normalize
 notifyParents
 prepareUpdate
 Radius
 remove
 removeChild
 removeDescendants
 resolveShortcuts
 setArrow
 setAttribute
 setDash
 setLabel
 setLabelText
 setName
 setParents
 setPosition
 setPositionDirectly
 setProperty deprecated
 setRadius
 shadow deprecated
 showElement
 snapToGrid
 snapToPoints
 strokeColor deprecated
 strokeWidth deprecated
 toJSON
 update
 updateQuadraticform
 updateRenderer
 updateStdform
 visible deprecated
 X
 Y
 Z
Properties
 _org_type
 _pos
 ancestors
 baseElement
 board
 center
 childElements
 circle
 descendants
 dump
 elementClass
 elType
 hasLabel
 highlighted
 id
 isDraggable
 isReal
 lastDragTime
 line
 method
 methodMap
 mouseover
 name
 needsUpdate
 notExistingParents
 numTraces
 parents
 point2
 quadraticform
 radius
 rendNode
 stdform
 subs
 symbolic
 traces
 transformations
 type
 visProp
Methods
_set

property

value
addChild

obj
Parameters:

obj
JXG.GeometryElementThe dependent object.
addDescendants

obj
Parameters:

obj
JXG.GeometryElementThe element that is to be added to the descendants list.
addParents

parents
Parameters:

parents
ArrayArray of elements or ids of elements. Alternatively, one can give a list of objects as parameters.
Returns:
Example:
// Movable function graph
var A = board.create('point', [1, 0], {name:'A'}),
B = board.create('point', [3, 1], {name:'B'}),
f = board.create('functiongraph', function(x) {
var ax = A.X(),
ay = A.Y(),
bx = B.X(),
by = B.Y(),
a = (by  ay) / ( (bx  ax) * (bx  ax) );
return a * (x  ax) * (x  ax) + ay;
}, {fixed: false});
f.addParents([A, B]);
addRotation

angle
Parameters:

angle
NumberThe degree of the rotation (90 means vertical text).
See also:
 JXG.GeometryElement#rotate
addTransform

transform
Add transformations to this circle.
Parameters:

transform
JXG.Transformation  ArrayEither one {@link JXG.Transformation} or an array of {@link JXG.Transformation}s.
Returns:
Reference to this circle object.
animate

hash

time

[options]
Parameters:
Returns:
clearTrace
()
chainable
cloneToBackground
()
chainable
countChildren
()
Number
private
Returns:
createGradient
()
private
chainable
See also:
 JXG.SVGRenderer#setGradient
createLabel
()
chainable
See also:
 #addLabelToElement
dash

d
Parameters:

d
NumberInteger which determines the way of dashing an element's outline.
See also:
draggable
()
Boolean
private
Returns:
fillColor

fColor
Parameters:

fColor
StringString which determines the fill color of an object.
See also:
generatePolynomial

p
Used to generate a polynomial for a point p that lies on this circle.
Parameters:

p
JXG.PointThe point for which the polynomial is generated.
Returns:
An array containing the generated polynomial.
generateRadiusSquared
()
String
private
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.
getAttribute

key
Parameters:

key
StringThe name of the property you are looking for
Returns:
getLabelAnchor
()
JXG.Coords
Returns:
See also:
getParents
()
Array
Get data to construct this element. Data consists of the parent elements and static data like radius.
Returns:
data necessary to construct this element
getProperty
()
deprecated
getTextAnchor
()
JXG.Coords
Returns:
See also:
getTpye
()
String
Returns:
handleSnapToGrid

force
Parameters:

force
Booleanforce snapping independent from what the snaptogrid attribute says
Returns:
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:
Returns:
True if (x,y) is near the circle, False otherwise.
hideElement
()
chainable
highlight

[force=false]
Parameters:

[force=false]
Boolean optionalForce the highlighting
highlightFillColor

fColor
Parameters:

fColor
StringString which determines the fill color of an object when its highlighted.
See also:
highlightStrokeColor

sColor
Parameters:

sColor
StringString which determines the stroke color of an object when its highlighted.
See also:
labelColor

lColor
Parameters:

lColor
StringString which determines the text color of an object's label.
See also:
maxX
()
private
Returns 1.
minX
()
private
Returns 0.
noHighlight
()
chainable
normalize
()
private
chainable
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:

contentStr
String
prepareUpdate
()
private
chainable
Radius

[value]
Calculates the radius of the circle or sets the radius.
Returns:
The radius of the circle
remove
()
chainable
removeChild

obj
Parameters:

obj
JXG.GeometryElementThe dependent object.
removeDescendants

obj
Parameters:

obj
JXG.GeometryElementThe element that is to be removed from the descendants list.
resolveShortcuts

properties
Parameters:

properties
Object
Returns:
setArrow

firstArrow

lastArrow
setAttribute

attributes
Parameters:

attributes
ObjectAn object with attributes.
Example:
// Set property directly on creation of an element using the attributes object parameter
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [1, 5, 5, 1]};
var p = board.create('point', [2, 2], {visible: false});
// Now make this point visible and fixed:
p.setAttribute({
fixed: true,
visible: true
});
setDash

dash
Parameters:

dash
NumberIndicates the new dash style
setLabel

str
Parameters:

str
String
setLabelText

str
Parameters:

str
String
setName

str
Parameters:

str
String
setParents

parents
Parameters:

parents
ArrayArray of elements or ids of elements. Alternatively, one can give a list of objects as parameters.
Returns:
setPosition

method

coords
Parameters:
Returns:
setPositionDirectly

method

coords

oldcoords
Parameters:
Returns:
setProperty
()
deprecated
setRadius

r
Set a new radius, then update the board.
Returns:
Reference to this circle
shadow

s
Parameters:

s
BooleanBoolean which determines whether the element has a shadow or not.
See also:
showElement
()
chainable
snapToGrid
()
JXG.GeometryElement
chainable
Returns:
snapToPoints
()
JXG.GeometryElement
chainable
Returns:
strokeColor

sColor
Parameters:

sColor
StringString which determines the stroke color of an object.
See also:
strokeWidth

width
Parameters:

width
NumberInteger which determines the stroke width of an outline.
See also:
toJSON
()
private
Returns:
update
()
chainable
updateQuadraticform
()
private
chainable
Updates this circle's undefined.
updateRenderer
()
private
chainable
updateStdform
()
private
chainable
Updates the stdform derived from the position of the center and the circle's radius.
visible

v
Parameters:

v
BooleanBoolean which determines whether the element is drawn.
See also:
X

t
Treats the circle as parametric curve running from 0 to 1 and calculates its X coordinate.
Parameters:

t
NumberNumber between 0 and 1.
Returns:
X(t)= radius*cos(t)+centerX.
Properties
_org_type
Number
final
center
JXG.Point
The circles center. Do not set this parameter directly as it will break JSXGraph's update system.
circle
JXG.Circle
only set if method equals 'pointLine'. Do not set this parameter directly as it will break JSXGraph's update system.
Default: null
See also:
 #method
dump
Boolean
Default: true
elType
String
hasLabel
Boolean
Default: false
isDraggable
Boolean
Default: false
lastDragTime
Date
Default: creation time
line
JXG.Line
only set if method equals 'pointLine'. Do not set this parameter directly as it will break JSXGraph's update system.
Default: null
See also:
 #method
method
String
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 also:
 #center
 #point2
 #radius
 #line
 #circle
methodMap
Object
name
String
Default: Name generated by {@link JXG.Board#generateName}.
See also:
notExistingParents
Object
numTraces
Number
See also:
 JXG.GeometryElement#traced
 JXG.GeometryElement#clearTrace
 JXG.GeometryElement#traces
quadraticform
Array
Default: [[1,0,0],[0,1,0],[0,0,1]]
stdform
Array
Default: [1, 0, 0, 0, 1, 1, 0, 0]
traces
Object
See also:
 JXG.GeometryElement#traced
 JXG.GeometryElement#clearTrace
 JXG.GeometryElement#numTraces
transformations
Array
See also:
Events
attribute
attribute:<attribute>
down
Event Payload:

e
EventThe browser's event object.
drag
Event Payload:

e
EventThe browser's event object.
mousedown
Event Payload:

e
EventThe browser's event object.
mousedrag
Event Payload:

e
EventThe browser's event object.
mousemove
Event Payload:

e
EventThe browser's event object.
mouseout
Event Payload:

e
EventThe browser's event object.
mouseover
Event Payload:

e
EventThe browser's event object.
mouseup
Event Payload:

e
EventThe browser's event object.
move
Event Payload:

e
EventThe browser's event object.
out
Event Payload:

e
EventThe browser's event object.
over
Event Payload:

e
EventThe browser's event object.
touchdown
Event Payload:

e
EventThe browser's event object.
touchdrag
Event Payload:

e
EventThe browser's event object.
touchup
Event Payload:

e
EventThe browser's event object.
up
Event Payload:

e
EventThe browser's event object.