c2.js
Options
All
Public
Public/Protected
All
Inherited
Externals
Only exported
Menu
Arc
Cell
Cell
Vertex
Circle
Convex
Hull
Delaunay
Limited
Voronoi
Line
Point
Polygon
constructor
vertices
add
area
bounds
centroid
circumference
clear
clip
clockwise
closest
contains
convex
distance
edges
reverse
rotate
scale
translate
Polyline
Quad
Tree
Rect
Sector
Spline
Triangle
Vector
Voronoi
Hierarchy
Polygon
Index
Constructors
constructor
Properties
vertices
Methods
add
area
bounds
centroid
circumference
clear
clip
clockwise
closest
contains
convex
distance
edges
reverse
rotate
scale
translate
Constructors
constructor
new
Polygon
(
)
:
Polygon
new
Polygon
(
points
:
Point
[]
)
:
Polygon
Returns
Polygon
Parameters
points:
Point
[]
Returns
Polygon
Properties
vertices
vertices
:
Point
[]
Methods
add
add
(
p
:
Point
)
:
Polygon
add
(
x
:
number
, y
:
number
)
:
Polygon
Parameters
p:
Point
Returns
Polygon
Parameters
x:
number
y:
number
Returns
Polygon
area
area
(
)
:
number
Returns
number
bounds
bounds
(
)
:
Rect
Returns
Rect
centroid
centroid
(
)
:
Point
Returns
Point
circumference
circumference
(
)
:
number
Returns
number
clear
clear
(
)
:
void
Returns
void
clip
clip
(
poly
:
Polygon
)
:
Polygon
Parameters
poly:
Polygon
Returns
Polygon
clockwise
clockwise
(
)
:
boolean
Returns
boolean
closest
closest
(
p
:
Point
)
:
Point
Parameters
p:
Point
Returns
Point
contains
contains
(
s
:
Point
|
Polygon
)
:
boolean
Parameters
s:
Point
|
Polygon
Returns
boolean
convex
convex
(
)
:
boolean
Returns
boolean
distance
distance
(
p
:
Point
)
:
number
Parameters
p:
Point
Returns
number
edges
edges
(
)
:
Line
[]
Returns
Line
[]
reverse
reverse
(
)
:
Polygon
Returns
Polygon
rotate
rotate
(
a
:
number
)
:
Polygon
rotate
(
a
:
number
, p
:
Point
)
:
Polygon
Parameters
a:
number
Returns
Polygon
Parameters
a:
number
p:
Point
Returns
Polygon
scale
scale
(
s
:
number
)
:
Polygon
scale
(
s
:
number
, p
:
Point
)
:
Polygon
Parameters
s:
number
Returns
Polygon
Parameters
s:
number
p:
Point
Returns
Polygon
translate
translate
(
x
:
any
, y
:
any
)
:
Polygon
Parameters
x:
any
y:
any
Returns
Polygon