com.partnersoft.geometry.xy
Interface XyArea<T extends XyArea>

All Superinterfaces:
Immutable, java.lang.Iterable<XyPoint>, XyShape<T>
All Known Implementing Classes:
XyBounds, XyCircle, XyEllipse, XyPolygon, XyQuadrilateral, XyRectangle, XyRegularPolygon, XyTriangle

public interface XyArea<T extends XyArea>
extends XyShape<T>

An XyArea is a shape that surrounds an interior.

Examples of areas are circles, squares, polygons, etc.

Copyright 2007 Partner Software, Inc.

Version:
$Id: XyArea.java 1012 2007-11-24 18:30:02Z paul $
Author:
Paul Reavis, Rich Stepanski, Richard Fay

Method Summary
 boolean contains(XyPoint point)
          Tests if a point is inside this area.
 double getArea()
          Returns the 2-dimensional area covered by this...
 double getPerimeter()
          Returns the total length of the lines and/or curves bounding the area.
 XyPolygon toPolygon()
          Same as 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.
 
Methods inherited from interface com.partnersoft.geometry.xy.XyShape
getBounds, scaledBy, transformedBy, translatedBy
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

contains

boolean contains(XyPoint point)
Tests if a point is inside this area.

Parameters:
point - point to test for containment

getArea

double getArea()
Returns the 2-dimensional area covered by this... area.

Returns:
geometric area of this shape

getPerimeter

double getPerimeter()
Returns the total length of the lines and/or curves bounding the area.

Returns:
geometric perimeter of this shape

toPolygon

XyPolygon toPolygon(XyAngle granularity)
Converts this area to a polygon which approximates it in some fashion. For example, a circle can be converted to a polygon with enough sides to roughly approximate its shape. Areas consisting of linked line segments can be represented exactly.

The 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

XyPolygon toPolygon()
Same as toPolygon(XyAngle) with a default angle granularity of 1/60 circle (1 degree, pi/30 radians).