Class JXG.Circle
Extends
JXG.GeometryElement.
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.
Constructor Attributes | Constructor Name and Description |
---|---|
JXG.Circle(board, method, p1, p2, radius, id, name, layer)
A circle consists of all points with a given distance from one point.
|
Field Attributes | Field Name and Description |
---|---|
Circle defining the radius of the circle given by the radius of the other circle
only set if method equals 'pointLine'.
|
|
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'.
|
|
Stores the given method.
|
|
The circles midpoint.
|
|
Point on the circle only set if method equals 'twoPoints'.
|
|
Radius of the circle
only set if method equals 'pointRadius'
|
- Fields borrowed from class JXG.GeometryElement:
- ancestors, board, childElements, dash, descendants, draft, fillColor, fillOpacity, fixed, hasLabel, highlightFillColor, highlightFillOpacity, highlightStrokeColor, highlightStrokeOpacity, highlightStrokeWidth, id, isReal, layer, name, needsRegularUpdate, needsUpdate, notExistingParents, numTraces, quadraticform, shadow, stdform, strokeColor, strokeOpacity, strokeWidth, symbolic, trace, traces, transformations, visible, visProp
Method Attributes | Method Name and Description |
---|---|
cloneToBackground(addToTrace)
Clone the circle to the background.
|
|
Radius()
Calculates the radius of the circle.
|
|
update()
Uses the boards renderer to update the circle.
|
|
X(t)
Treat the circle as parametric curve:
Return X(t)= radius*cos(t)+centerX, where t runs from 0 to 1.
|
|
Y(t)
Treat the circle as parametric curve:
Return Y(t)= radius*cos(t)+centerX
t runs from 0 to 1
|
- Methods borrowed from class JXG.GeometryElement:
- addChild, addLabelToElement, animate, clearTrace, hideElement, highlight, labelColor, noHighlight, remove, setArrow, setProperty, showElement
Class Detail
JXG.Circle(board, method, p1, p2, radius, id, name, layer)
A circle consists of all points with a given distance from one point. This point is called midpoint, the distance is called radius.
A circle can be constructed by providing a midpoint and a point on the circle or a midpoint 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 midpoint and a point on the circle.
- 'pointRadius' which means the circle is defined by its midpoint and its radius in user units
- 'pointLine' which means the circle is defined by its midpoint 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 midpoint and its radius given by the radius of another circle
- {JXG.Point} p1
- Midpoint 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.
- layer
Field Detail
{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 midpoint and a point on the circle.
- 'pointRadius' which means the circle is defined by its midpoint and its radius given in user units or as term.
- 'pointLine' which means the circle is defined by its midpoint 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 midpoint and its radius given by the radius of another circle.
{JXG.Point}
midpoint
The circles midpoint. Do not set this parameter directly as it will break JSXGraph's update system.
{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
cloneToBackground(addToTrace)
Clone the circle to the background.
- Parameters:
- {boolean} addToTrace
- Not used yet. Always true.
getRadius()
{float}
Radius()
Calculates the radius of the circle.
- Returns:
- The radius of the circle
update()
Uses the boards renderer to update the circle.
{float}
X(t)
Treat the circle as parametric curve:
Return X(t)= radius*cos(t)+centerX, where t runs from 0 to 1.
- Parameters:
- {float} t
- TODO description
- Returns:
- TODO description
{float}
Y(t)
Treat the circle as parametric curve:
Return Y(t)= radius*cos(t)+centerX
t runs from 0 to 1
- Parameters:
- {float} t
- TODO description
- Returns:
- TODO description