Documentation of 'math.geom2d.polygon.Polygon2D' Java class
Polygon2D
math.geom2d.polygon

Interface Polygon2D

    • Method Detail

      • vertices

        java.util.Collection<Point2D> vertices()
        Returns the vertices (singular points) of the polygon
      • vertex

        Point2D vertex(int i)
        Returns the i-th vertex of the polygon.
        Parameters:
        i - index of the vertex, between 0 and the number of vertices
      • setVertex

        void setVertex(int i,
                       Point2D point)
        Sets the position of the i-th vertex
        Parameters:
        i - the vertex index
        point - the new position of the vertex
        Throws:
        java.lang.UnsupportedOperationException - if this polygon implementation does not support vertex modification
      • addVertex

        void addVertex(Point2D point)
        Adds a vertex as last vertex of this polygon.
        Parameters:
        point - the position of the new vertex
        Throws:
        java.lang.UnsupportedOperationException - if this polygon implementation does not support vertex modification
      • insertVertex

        void insertVertex(int index,
                          Point2D point)
        Inserts a vertex at the specified position.
        Parameters:
        index - index at which the specified vertex is to be inserted
        point - the position of the new vertex
        Throws:
        java.lang.UnsupportedOperationException - if this polygon implementation does not support vertex modification
      • removeVertex

        void removeVertex(int index)
        Removes the vertex at the given index.
        Parameters:
        index - index of the vertex to remove
        Throws:
        java.lang.UnsupportedOperationException - if this polygon implementation does not support vertex modification
      • vertexNumber

        int vertexNumber()
        Returns the number of vertices of the polygon
        Since:
        0.6.3
      • closestVertexIndex

        int closestVertexIndex(Point2D point)
        Returns the index of the closest vertex to the input point.
      • edges

        java.util.Collection<? extends LineSegment2D> edges()
        Return the edges as line segments of the polygon
      • edgeNumber

        int edgeNumber()
        Returns the number of edges of the polygon
      • centroid

        Point2D centroid()
        Returns the centroid (center of mass) of the polygon.
      • area

        double area()
        Returns the signed area of the polygon.
      • contours

        java.util.Collection<? extends LinearRing2D> contours()
        Description copied from interface: Domain2D
        Returns the set of contours that enclose this domain. The result is a collection of shapes that implement the Contour2D interface.
        Specified by:
        contours in interface CirculinearDomain2D
        Specified by:
        contours in interface Domain2D
        See Also:
        Contour2D
      • transform

        Polygon2D transform(AffineTransform2D trans)
        Returns the new Polygon created by an affine transform of this polygon.
        Specified by:
        transform in interface Domain2D
        Specified by:
        transform in interface Shape2D
        Parameters:
        trans - an affine transform
        Returns:
        the transformed shape
      • clip

        Polygon2D clip(Box2D box)
        Description copied from interface: Shape2D
        Clip the shape with the given box, and returns a new shape. The box must be bounded.
        Specified by:
        clip in interface Domain2D
        Specified by:
        clip in interface Shape2D
        Parameters:
        box - the clipping box
        Returns:
        the clipped shape

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.