maspack.geometry
Class ConvexPolygon2d

java.lang.Object
  extended by maspack.geometry.Polygon2d
      extended by maspack.geometry.ConvexPolygon2d
All Implemented Interfaces:
GLRenderable, GLSelectable, HasRenderProps, Renderable

public class ConvexPolygon2d
extends Polygon2d


Field Summary
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
ConvexPolygon2d()
           
ConvexPolygon2d(double[] coords)
           
ConvexPolygon2d(Point2d[] pnts)
           
 
Method Summary
 double area()
           
 int pointIsInside(Point2d pnt)
          Returns 1 or -1 depending on whether pnt is (strictly) inside or outside of poly.
 
Methods inherited from class maspack.geometry.Polygon2d
addVertex, appendVertex, clear, createRenderProps, epsilonEquals, equals, getBounds, getCentroid, getFirstVertex, getLastVertex, getMaxCoordinate, getRenderHints, getRenderProps, getSelection, getVertices, inverseTransform, isConsistent, isEmpty, isSelectable, numSelectionQueriesNeeded, numVertices, prependVertex, prerender, render, render, scan, set, set, set, setRenderProps, shiftVertices, toString, toString, toString, transform, updateBounds, updateBounds
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConvexPolygon2d

public ConvexPolygon2d()

ConvexPolygon2d

public ConvexPolygon2d(double[] coords)

ConvexPolygon2d

public ConvexPolygon2d(Point2d[] pnts)
Method Detail

area

public double area()

pointIsInside

public int pointIsInside(Point2d pnt)
Returns 1 or -1 depending on whether pnt is (strictly) inside or outside of poly.

Returns:
1 for inside and -1 for outside