|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.geometry.xy.XyRegularPolygon
public class XyRegularPolygon
A regular polygon has equal-length sides and equal-size angles. It can have any number of sides greater than two. We allow it to be placed at any desired center point, radius, and rotation.
Regular polygons are also referred to as n-gons (e.g. 5-gon, 8-gon, etc.).
Copyright 2007 Partner Software, Inc.
| Constructor Summary | |
|---|---|
XyRegularPolygon(XyPoint center,
double radius,
int pointCount)
|
|
XyRegularPolygon(XyPoint center,
double radius,
int pointCount,
XyRotation rotation)
|
|
| Method Summary | |
|---|---|
boolean |
contains(XyPoint point)
Tests if a point is inside this area. |
boolean |
equals(java.lang.Object nother)
|
double |
getArea()
Returns the 2-dimensional area covered by this... |
XyBounds |
getBounds()
Returns an XyBounds object representing the rectangular extents of this shape. |
double |
getPerimeter()
Returns the total length of the lines and/or curves bounding the area. |
java.util.Iterator<XyPoint> |
iterator()
|
XyRegularPolygon |
scaledBy(double factor)
Return a scaled version of the shape by multiplying all coordinates by the given factor in both dimensions. |
XyPolygon |
toPolygon()
Same as XyArea.toPolygon(XyAngle) with a default angle granularity of
1/60 circle (1 degree, pi/30 radians). |
XyPolygon |
toPolygon(XyAngle granularity)
Converts this area to a polygon which approximates it in some fashion. |
XyPolyline |
toPolyline()
|
java.lang.String |
toString()
|
XyShape |
transformedBy(XyTransform transform)
Transform the shape using the given transform. |
XyRegularPolygon |
translatedBy(double offsetX,
double offsetY)
Translate the shape by adding all coordinates to the given x and y offsets. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public XyRegularPolygon(XyPoint center,
double radius,
int pointCount)
public XyRegularPolygon(XyPoint center,
double radius,
int pointCount,
XyRotation rotation)
| Method Detail |
|---|
public XyPolyline toPolyline()
public XyRegularPolygon scaledBy(double factor)
XyShape
scaledBy in interface XyShape<XyRegularPolygon>factor - scaling factor
public XyRegularPolygon translatedBy(double offsetX,
double offsetY)
XyShape
translatedBy in interface XyShape<XyRegularPolygon>offsetX - offset for the x dimensionoffsetY - offset for the y dimension
public XyShape transformedBy(XyTransform transform)
XyShape
transformedBy in interface XyShape<XyRegularPolygon>transform - affine transform to apply.
public boolean contains(XyPoint point)
XyArea
contains in interface XyArea<XyRegularPolygon>point - point to test for containmentpublic XyPolygon toPolygon()
XyAreaXyArea.toPolygon(XyAngle) with a default angle granularity of
1/60 circle (1 degree, pi/30 radians).
toPolygon in interface XyArea<XyRegularPolygon>public XyPolygon toPolygon(XyAngle granularity)
XyAreaThe angle parameter allows a certain level of control of the output. Essentially it dictates the minimum angular granularity used to approximate curved paths. For example, a circle would be turned into a polygon by placing points around the circle, separated by the given angle.
toPolygon in interface XyArea<XyRegularPolygon>public double getArea()
XyArea
getArea in interface XyArea<XyRegularPolygon>public double getPerimeter()
XyArea
getPerimeter in interface XyArea<XyRegularPolygon>public XyBounds getBounds()
XyShape
getBounds in interface XyShape<XyRegularPolygon>public java.util.Iterator<XyPoint> iterator()
iterator in interface java.lang.Iterable<XyPoint>public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object nother)
equals in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||