# Circle

Class representing a circle

## Constructor

#### new Circle(pc, r)

Source:
  - classes/circle.js, line 15

##### Parameters:

Name | Type | Description
--- | --- | ---
`pc` | `Point` | circle center point
`r` | `number` | circle radius

### Classes

Circle

### Members

#### box

Circle bounding box

Source:
  - classes/circle.js, line 68

#### center

Circle center

Source:
  - classes/circle.js, line 60

#### pc :Point

Circle center

Source:
  - classes/circle.js, line 26

##### Type:

- `Point`

#### r :number

Circle radius

Source:
  - classes/circle.js, line 31

##### Type:

- `number`

### Methods

#### clone() → {Circle}

Return new cloned instance of circle

Source:
  - classes/circle.js, line 52

##### Returns:

Type:
  `Circle`

#### contains(shape) → {boolean}

Return true if circle contains shape: no point of shape lies outside of the circle

Source:
  - classes/circle.js, line 82

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape` | `Shape` | test shape

##### Returns:

Type:
  `boolean`

#### distanceTo(shape) → {number|Segment}

Calculate distance and shortest segment from circle to shape and return array [distance, shortest segment]

Source:
  - classes/circle.js, line 156

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape` | `Shape` | Shape of the one of supported types Point, Line, Circle, Segment, Arc, Polygon or Planar Set

##### Returns:

- Type:
    `number`
  distance from circle to shape
- Type:
    `Segment`
  shortest segment between circle and shape (started at circle, ended at shape)

#### intersect(shape) → {Array.<Point>}

Returns array of intersection points between circle and other shape

Source:
  - classes/circle.js, line 121

##### Parameters:

Name | Type | Description
--- | --- | ---
`shape` | `Shape` | Shape of the one of supported types

##### Returns:

Type:
  `Array.<Point>`

#### svg(attrs) → {string}

Return string to draw circle in svg

Source:
  - classes/circle.js, line 210

##### Parameters:

Name | Type | Description
--- | --- | ---
`attrs` | `Object` | an object with attributes of svg circle element

##### Returns:

Type:
  `string`

#### toArc(counterclockwise) → {Arc}

Transform circle to closed arc

Source:
  - classes/circle.js, line 112

##### Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`counterclockwise` | `boolean` | true |

##### Returns:

Type:
  `Arc`

#### toJSON() → {Object}

This method returns an object that defines how data will be serialized when called JSON.stringify() method

Source:
  - classes/circle.js, line 201

##### Returns:

Type:
  `Object`