com.mizar.geometry
Class Rectangle

java.lang.Object
  extended by com.mizar.geometry.Geometry
      extended by com.mizar.geometry.Polyline
          extended by com.mizar.geometry.Polygon
              extended by com.mizar.geometry.OrthoPolygon
                  extended by com.mizar.geometry.Rectangle
All Implemented Interfaces:
OneCell, TwoCell
Direct Known Subclasses:
Square

public class Rectangle
extends OrthoPolygon


Nested Class Summary
 
Nested classes/interfaces inherited from class com.mizar.geometry.Geometry
Geometry.Results
 
Field Summary
protected static boolean equiangular
           
protected  int maximumCoordinates
           
protected  int minimumCoordinates
           
protected  java.lang.Double rectangleAngle
           
protected  java.lang.Double rectangleLength
           
protected  java.lang.Double rectangleWidth
           
 
Fields inherited from class com.mizar.geometry.OrthoPolygon
orthogonal
 
Fields inherited from class com.mizar.geometry.Polyline
equilateral
 
Fields inherited from class com.mizar.geometry.Geometry
defaultOrdinates, dimensions, geographic, LEFTSIDE, mbr, ONLINE, ordinates, precision, results, RIGHTSIDE, SIDE, toStringDecimals
 
Constructor Summary
Rectangle()
           
Rectangle(double[] ordinates)
           
Rectangle(double[] ordinates, double precision)
           
Rectangle(double[] line, double width, double precision)
           
Rectangle(double[] ordinates, int dimensions, double precision)
           
 
Method Summary
 void expand(double factor)
          THIS WOULD ONLY WORK IF THE RECTANGLE HAS AN ORTHOGANAL ORIENTATION.
static double[] expand(double[] range, double factor)
           
 int getMinimumCoordinates()
           
 java.lang.Double getRectangleAngle()
           
 java.lang.Double getRectangleLength()
           
static java.util.List<Rectangle> getRectangles(double[] ordinates, double width, double length)
           
 java.lang.Double getRectangleWidth()
           
 boolean isEquiangular()
           
static void main(java.lang.String[] argv)
           
 java.lang.String toString()
           
 boolean validate()
           
 
Methods inherited from class com.mizar.geometry.Polygon
closeArea, computePolygonArea, computePolygonCentroid, getArea, getAreaAbsolute, getCentroid, isPointInsideMBR, isPointInsidePolygon, isPointInsidePolygon, isPointInsidePolygon, isPointInsidePolygon, isPointInsidePolygonX, polygonArea, polygonAreaAbsolute, polygonCentroid
 
Methods inherited from class com.mizar.geometry.Polyline
addCoordinate, addCoordinate, addPoint, breakAtCoordinateIndex, changeDimensionality, clone, conflateTo, contains, contains, contains, getClosestPoint, getClosestSegment, getCoordinateOnLine, getDistanceTo, getDistanceTo, getEndPoint, getEndPointXY, getLength, getLength3D, getLine, getLine, getLineOrdinates, getOrdinatesBetween, getPointAsCrowFlies, getPointAsCrowFlies, getPointAtDistance, getPointAtDistance, getRemainingOrdinates, getSegmentAtDistance, getSegmentAtDistance, getSegments, getSelfIntersections, getShortestDistance, getStartPoint, getStartPointXY, getWkt, hasIntersections, hasNonconnectingIntersections, intersect, intersect, isEquilateral, isOrthogonal, isPointOnLine, isSame, isSelfIntersecting, join, length, length, lengthAlong, lengthAlong, lengthBetween, lengthBetween, patch, patch, removeCoordinate, reverse, reverse, setEquiangular, setEquilateral, setOrthogonal, shiftParallel, shiftParallel, shiftParallel, shiftParallel, snap, snap, snap, snap, split, split, thin, thin, thin, thinSimple, thinSimple
 
Methods inherited from class com.mizar.geometry.Geometry
adjustEndPoints, adjustEndPoints, adjustEndPoints, adjustEndPoints, changeDimensions, computeMbr, computeMbr, computeMbr, computeNearestDistance, computeNearestDistance, connectsTo, connectsTo, connectsTo, connectsTo, constructDefaultPoint, equals, expandMbr, getCoordinate, getCoordinates, getCoordinates, getCoordinates, getCoordinates, getDefaultOrdinates, getDimensions, getEndCoordinateIndex, getFirstPoint, getFirstPoint, getLastPoint, getLastPoint, getLeastDimension, getLeastPrecise, getLength, getMaximumCoordinates, getMbr, getMbrCorner, getMbrCorner, getMostPrecise, getNumberOfCoordiates, getOrdinates, getPoints, getPointWithMatchingDimensions, getPrecision, getRange, getRange, getResults, getSegment, getToStringDecimals, getXYCoordinates, getXYCoordinates, hashCode, isCoveredByMbr, isEqualOrBetween, isGeographic, isInsideMbr, isSame, mbrIntersect, mbrOverlap, mbrOverlap, mbrOverlapRatio, mbrValid, polygonizeMbr, quadrant, seedMbr, setCoordinate, setCoordinates, setCoordinates, setDefaultOrdinates, setDimensions, setFirstPoint, setGeographic, setLastPoint, setMaximumCoordinates, setMinimumCoordinates, setOrdinates, setPrecision, setSegment, setToStringDecimals, updateMbr
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mizar.geometry.TwoCell
getDimensions
 
Methods inherited from interface com.mizar.geometry.OneCell
getDimensions, getFirstPoint, getLastPoint, setFirstPoint, setLastPoint
 

Field Detail

maximumCoordinates

protected final int maximumCoordinates
See Also:
Constant Field Values

minimumCoordinates

protected final int minimumCoordinates
See Also:
Constant Field Values

equiangular

protected static boolean equiangular

rectangleWidth

protected java.lang.Double rectangleWidth

rectangleLength

protected java.lang.Double rectangleLength

rectangleAngle

protected java.lang.Double rectangleAngle
Constructor Detail

Rectangle

public Rectangle()

Rectangle

public Rectangle(double[] ordinates)
          throws GeometryException
Throws:
GeometryException

Rectangle

public Rectangle(double[] ordinates,
                 double precision)
          throws GeometryException
Throws:
GeometryException

Rectangle

public Rectangle(double[] ordinates,
                 int dimensions,
                 double precision)
          throws GeometryException
Throws:
GeometryException

Rectangle

public Rectangle(double[] line,
                 double width,
                 double precision)
          throws GeometryException
Parameters:
line - must be exactly 4 ordinates representing x1,y1,x2,y2 being the beginning and end points of a line
width - the size to expand line at to the left and right
precision -
Throws:
GeometryException
Method Detail

getRectangles

public static java.util.List<Rectangle> getRectangles(double[] ordinates,
                                                      double width,
                                                      double length)
                                               throws GeometryException
Parameters:
ordinates - an array of 2-dimensional XY ordinates
width -
length -
Returns:
Throws:
GeometryException

validate

public boolean validate()
Overrides:
validate in class OrthoPolygon

expand

public void expand(double factor)
            throws GeometryException
THIS WOULD ONLY WORK IF THE RECTANGLE HAS AN ORTHOGANAL ORIENTATION. NEED MORE

Parameters:
factor -
Throws:
GeometryException

expand

public static double[] expand(double[] range,
                              double factor)
                       throws GeometryException
Throws:
GeometryException

getMinimumCoordinates

public int getMinimumCoordinates()
Overrides:
getMinimumCoordinates in class Geometry
Returns:

isEquiangular

public boolean isEquiangular()
Overrides:
isEquiangular in class Polyline
Returns:

getRectangleWidth

public java.lang.Double getRectangleWidth()

getRectangleLength

public java.lang.Double getRectangleLength()

getRectangleAngle

public java.lang.Double getRectangleAngle()

toString

public java.lang.String toString()
Overrides:
toString in class Geometry

main

public static void main(java.lang.String[] argv)