public class XyQuadrilateral extends java.lang.Object implements XyArea<XyQuadrilateral>
Copyright 2008 Partner Software, Inc.
| Constructor and Description |
|---|
XyQuadrilateral(XyPoint corner1,
XyPoint corner2,
XyPoint corner3,
XyPoint corner4) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(XyPoint point)
Tests if a point is inside this area.
|
double |
getArea()
Returns the 2-dimensional area covered by this...
|
XyBounds |
getBounds()
Returns an XyBounds object representing the rectangular extents of this
shape.
|
XyPoint |
getCentroid() |
XyPoint |
getCorner1() |
XyPoint |
getCorner2() |
XyPoint |
getCorner3() |
XyPoint |
getCorner4() |
double |
getPerimeter()
Returns the total length of the lines and/or curves bounding the area.
|
java.util.Iterator<XyPoint> |
iterator() |
XyQuadrilateral |
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.
|
XyShape |
transformedBy(XyTransform transform)
Transform the shape using the given transform.
|
XyQuadrilateral |
translatedBy(double offsetX,
double offsetY)
Translate the shape by adding all coordinates to the given x and y
offsets.
|
public boolean contains(XyPoint point)
XyAreacontains in interface XyArea<XyQuadrilateral>point - point to test for containmentpublic double getArea()
XyAreagetArea in interface XyArea<XyQuadrilateral>public double getPerimeter()
XyAreagetPerimeter in interface XyArea<XyQuadrilateral>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<XyQuadrilateral>public XyPolygon toPolygon()
XyAreaXyArea.toPolygon(XyAngle) with a default angle granularity of
1/60 circle (1 degree, pi/30 radians).toPolygon in interface XyArea<XyQuadrilateral>public XyBounds getBounds()
XyShapegetBounds in interface XyShape<XyQuadrilateral>public XyQuadrilateral scaledBy(double factor)
XyShapescaledBy in interface XyShape<XyQuadrilateral>factor - scaling factorpublic XyShape transformedBy(XyTransform transform)
XyShapetransformedBy in interface XyShape<XyQuadrilateral>transform - affine transform to apply.public XyQuadrilateral translatedBy(double offsetX, double offsetY)
XyShapetranslatedBy in interface XyShape<XyQuadrilateral>offsetX - offset for the x dimensionoffsetY - offset for the y dimensionpublic java.util.Iterator<XyPoint> iterator()
iterator in interface java.lang.Iterable<XyPoint>public XyPoint getCentroid()
public XyPoint getCorner1()
public XyPoint getCorner2()
public XyPoint getCorner3()
public XyPoint getCorner4()