Modifier | Constructor and Description |
---|---|
protected |
Polygon() |
Modifier and Type | Method and Description |
---|---|
double |
area()
Returns the signed area of this polygon.
|
Array<?> |
centroid()
Returns a two-element array representing the centroid of this polygon.
|
Array<?> |
centroid(double k)
Returns a two-element array representing the centroid of this polygon.
|
Polygon |
clip(Array<Array<Double>> subject)
Clips the subject polygon against this polygon.
|
asIterable, asList, concat, concat, concat, concat, concat, create, every, every, filter, filter, forEach, forEach, fromBytes, fromChars, fromDoubles, fromFloats, fromInts, fromIterable, fromJavaArray, fromLongs, fromObjects, fromShorts, get, getBoolean, getInt, getNumber, getObject, getString, getValue, indexOf, indexOf, join, join, lastIndexOf, lastIndexOf, length, map, map, map, pop, popBoolean, popNumber, popObject, popString, push, push, push, push, reverse, set, set, set, set, set, setLength, shiftBoolean, shiftNumber, shiftObject, shiftString, slice, slice, some, some, sortAlphaAsc, sortAlphaDesc, sortNumericAsc, sortNumericDesc, splice, splice, splice, splice, splice, splice, unshift, unshift, unshift, unshift
public final double area()
If the vertices are in counterclockwise order, the area is positive, otherwise it is negative.
public final Array<?> centroid()
public final Array<?> centroid(double k)
k
- a scale factorpublic final Polygon clip(Array<Array<Double>> subject)
In other words, returns a polygon representing the intersection of this polygon and the subject polygon.
Assumes the clip polygon is counterclockwise and convex.
subject
- the polygon to clip againstCopyright © 2015 gwt-d3. All rights reserved.