Circle

Element

A circle can be defined by various combinations of points and numbers. 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). If the radius is a negative value, its absolute values is taken.

Usage (signatures)
board.create('circle', [center, radius]);
Parameters
Name Type Description
center PointLike
radius NumberLike

The absolute value of this number is taken as radius

Example
// Create a circle providing two points
var p1 = board.create('point', [2.0, 2.0]),
    c1 = board.create('circle', [p1, 3]);

// Create another circle using the above circle
var c2 = board.create('circle', [function() { return [p1.X(), p1.Y() + 1];}, function() { return c1.Radius(); }]);
board.create('circle', [center, point]);
Parameters
Name Type Description
center PointLike
point PointLike

Point on circle, defining the radius

Example
// Create a circle providing two points
var p1 = board.create('point', [2.0, 2.0]),
    p2 = board.create('point', [2.0, 0.0]),
    c1 = board.create('circle', [p1, p2]);

board.create('circle', [center, line]);
Parameters
Name Type Description
center PointLike
line Line

Line, the distance of its start and end point of the determines the radius

Example
// Create a line providing two points
var p1 = board.create('point', [2.0, 2.0]),
    p2 = board.create('point', [2.0, 0.0]),
    l1 = board.create('line', [p1, p2]);

// Create another circle using the above circle
var p3 = board.create('point', [3.0, 2.0]),
    c = board.create('circle', [p3, l1]);
board.create('circle', [center, circle]);
Parameters
Name Type Description
center PointLike
circle Circle

The circle radius is copied from the radius of that circle

Example
// Create a circle providing two points
var p1 = board.create('point', [2.0, 2.0]),
    p2 = board.create('point', [2.0, 0.0]),
    c1 = board.create('circle', [p1, p2]);

// Create another circle using the above circle
var p3 = board.create('point', [3.0, 2.0]),
    c2 = board.create('circle', [p3, c1]);
board.create('circle', [circle, t]);
Parameters
Name Type Description
circle Circle
t Transfomation
Examples
var t = board.create('transform', [2, 1.5], {type: 'scale'});
var c1 = board.create('circle', [[1.3, 1.3], [0, 1.3]], {strokeColor: 'black', center: {visible:true}});
var c2 = board.create('circle', [c1, t], {strokeColor: 'black'});

var li = board.create('line', [1,1,1], {strokeColor: '#aaaaaa'});
var reflect = board.create('transform', [li], {type: 'reflect'});

var c1 = board.create('circle', [[-2,-2], [-2, -1]], {center: {visible:true}});
var c2 = board.create('circle', [c1, reflect]);
Attributes

Own

center

Description

Attributes for center point.

Type
Point
Overrides
JXG.Circle#center
Source
options.js, line 4927

hasInnerPoints

Description

If true, moving the mouse over inner points triggers hasPoint.

Type
Boolean
Default Value
false
See
Source
options.js, line 4911

label

Description

Attributes for circle label.

Type
Label
Source
options.js, line 4968

point

Description

Attributes for center point.

Type
Point
Source
options.js, line 5054

point2

Description

Attributes for center point.

Type
Point
Overrides
JXG.Circle#point2
Source
options.js, line 4948

Inherited

Members

Own

none

Inherited

Methods

Own

none

Inherited

Events

Own

none

Inherited

Throws

If the element cannot be constructed with the given parent objects an exception is thrown.

Type
Exception

Details

Type
JXG.Circle
Source
base/circle.js, line 860

Extends