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

Class LinearCurve2D

    • Method Detail

      • simplify

        public abstract LinearCurve2D simplify(double distMax)
        Returns a simplified version of this linear curve. Sub classes may override this method to return a more specialized type.
      • vertexIterator

        public java.util.Iterator<Point2D> vertexIterator()
        Returns an iterator on the collection of points.
      • vertexArray

        public Point2D[] vertexArray()
        Returns the collection of vertices as an array of Point2D.
        Returns:
        an array of Point2D
      • addVertex

        public boolean addVertex(Point2D vertex)
        Adds a vertex at the end of this polyline.
        Returns:
        true if the vertex was correctly added
        Since:
        0.9.3
      • insertVertex

        public void insertVertex(int index,
                                 Point2D vertex)
        Inserts a vertex at a given position in the polyline.
        Since:
        0.9.3
      • removeVertex

        public boolean removeVertex(Point2D vertex)
        Removes the first instance of the given vertex from this polyline.
        Parameters:
        vertex - the position of the vertex to remove
        Returns:
        true if the vertex was actually removed
        Since:
        0.9.3
      • removeVertex

        public Point2D removeVertex(int index)
        Removes the vertex specified by the index.
        Parameters:
        index - the index of the vertex to remove
        Returns:
        the position of the vertex removed from the polyline
        Since:
        0.9.3
      • setVertex

        public void setVertex(int index,
                              Point2D position)
        Changes the position of the i-th vertex.
        Since:
        0.9.3
      • clearVertices

        public void clearVertices()
      • vertex

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

        public int vertexNumber()
        Returns the number of vertices.
        Returns:
        the number of vertices
      • closestVertexIndex

        public int closestVertexIndex(Point2D point)
        Computes the index of the closest vertex to the input point.
      • edge

        public abstract LineSegment2D edge(int index)
        Returns the i-th edge of this linear curve.
      • edgeNumber

        public abstract int edgeNumber()
        Returns the number of edges of this linear curve.
      • edges

        public abstract java.util.Collection<LineSegment2D> edges()
        Returns a collection of LineSegment2D that represent the individual edges of this linear curve.
        Returns:
        the edges of the polyline
      • length

        public double length()
        Specified by:
        length in interface CirculinearCurve2D
        Returns:
        the length of the curve
      • length

        public double length(double pos)
        Specified by:
        length in interface CirculinearCurve2D
        Returns:
        the length from the beginning to the position given by pos
      • position

        public double position(double length)
        Specified by:
        position in interface CirculinearCurve2D
        Returns:
        the position located at a given geodesic distance from the origin
      • buffer

        public CirculinearDomain2D buffer(double dist)
        Description copied from interface: CirculinearShape2D
        Computes the buffer of the shape, formed by the set of points located at a distance from the shape that is lower or equal to d.
        Specified by:
        buffer in interface CirculinearShape2D
        Parameters:
        dist - the maximal distance between a point of the buffer and the shape
        Returns:
        the buffer of the shape
      • parallel

        public CirculinearContinuousCurve2D parallel(double d)
        Description copied from interface: CirculinearCurve2D
        Creates a new curve, formed by the points with parameterization: p(t) = c(t) + d*n(t)/|n(t)|, with p(t) being a point of the original curve, n(t) the normal of the curve, and |n| being the norm of n.
        In the case of a continuous curve formed by several smooth circulinear elements, the parallels of contiguous elements are joined by a circle arc.
        Specified by:
        parallel in interface CirculinearContinuousCurve2D
        Specified by:
        parallel in interface CirculinearCurve2D
        Parameters:
        d - the distance between the original curve and he parallel curve.
        Returns:
        the parallel curve
      • signedDistance

        public double signedDistance(Point2D point)
        Description copied from interface: OrientedCurve2D
        Returns the signed distance of the curve to the given point. The distance is positive if the point lies outside the shape, and negative if the point lies inside the shape. In both cases, absolute value of distance is equals to the distance to the border of the shape.
        Specified by:
        signedDistance in interface OrientedCurve2D
        Parameters:
        point - a point of the plane
        Returns:
        the signed distance to the curve
      • signedDistance

        public double signedDistance(double x,
                                     double y)
        Description copied from interface: OrientedCurve2D
        The same as distanceSigned(Point2D), but by passing 2 double as arguments.
        Specified by:
        signedDistance in interface OrientedCurve2D
        Parameters:
        x - x-coord of a point
        y - y-coord of a point
        Returns:
        the signed distance of the point (x,y) to the curve
      • leftTangent

        public Vector2D leftTangent(double t)
        Description copied from interface: ContinuousCurve2D
        Computes the left tangent at the given position. If the curve is smooth at position t, the result is the same as the tangent computed for the corresponding smooth curve, and is equal to the result of rightTangent(double). If the position t corresponds to a singular point, the tangent of the smooth portion before t is computed.
        Specified by:
        leftTangent in interface ContinuousCurve2D
        Parameters:
        t - the position on the curve
        Returns:
        the left tangent vector at the curve for position t
      • rightTangent

        public Vector2D rightTangent(double t)
        Description copied from interface: ContinuousCurve2D
        Computes the right tangent at the given position. If the curve is smooth at position t, the result is the same as the tangent computed for the corresponding smooth curve, and is equal to the result of leftTangent(double). If the position t corresponds to a singular point, the tangent of the smooth portion after t is computed.
        Specified by:
        rightTangent in interface ContinuousCurve2D
        Parameters:
        t - the position on the curve
        Returns:
        the right tangent vector at the curve for position t
      • curvature

        public double curvature(double t)
        Description copied from interface: ContinuousCurve2D
        Computes the curvature at the given position. The curvature is finite for positions t that correspond to smooth parts, and is infinite for singular points.
        Specified by:
        curvature in interface ContinuousCurve2D
        Parameters:
        t - the position on the curve
        Returns:
        the curvature of the curve for position t
      • t0

        public double t0()
        Returns 0.
        Specified by:
        t0 in interface Curve2D
      • getT0

        @Deprecated
        public double getT0()
        Deprecated. replaced by t0() (since 0.11.1).
        Specified by:
        getT0 in interface Curve2D
      • singularPoints

        public java.util.Collection<Point2D> singularPoints()
        Description copied from interface: Curve2D
        Returns a set of singular points, i. e. which do not locally admit derivative.
        Specified by:
        singularPoints in interface Curve2D
        Returns:
        a collection of Point2D.
        See Also:
        Curve2D.vertices()
      • isSingular

        public boolean isSingular(double pos)
        Description copied from interface: Curve2D
        Checks if a point is singular.
        Specified by:
        isSingular in interface Curve2D
        Parameters:
        pos - the position of the point on the curve
        Returns:
        true if the point at this location is singular
      • position

        public double position(Point2D point)
        Description copied from interface: Curve2D
        Computes the position of the point on the curve. If the point does not belong to the curve, return Double.NaN. It is complementary to the point(double) method.
        Specified by:
        position in interface Curve2D
        Parameters:
        point - a point belonging to the curve
        Returns:
        the position of the point on the curve
        See Also:
        Curve2D.point(double)
      • intersections

        public java.util.Collection<Point2D> intersections(LinearShape2D line)
        Description copied from interface: Curve2D
        Returns the intersection points of the curve with the specified line. The length of the result array is the number of intersection points.
        Specified by:
        intersections in interface Curve2D
      • project

        public double project(Point2D point)
        Description copied from interface: Curve2D
        Returns the position of the closest orthogonal projection of the point on the curve, or of the closest singular point. This function should always returns a valid value.
        Specified by:
        project in interface Curve2D
        Parameters:
        point - a point to project
        Returns:
        the position of the closest orthogonal projection
      • distance

        public double distance(double x,
                               double y)
        Description copied from interface: Shape2D
        Returns the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e. fillable) shape.
        Specified by:
        distance in interface Shape2D
      • distance

        public double distance(Point2D point)
        Description copied from interface: Shape2D
        Returns the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.
        Specified by:
        distance in interface Shape2D
      • isEmpty

        public boolean isEmpty()
        Returns true if the polyline does not contain any point.
        Specified by:
        isEmpty in interface Shape2D
        Returns:
        true if the shape does not contain any point.
      • isBounded

        public boolean isBounded()
        Always returns true, because a linear curve is always bounded.
        Specified by:
        isBounded in interface Shape2D
      • boundingBox

        public Box2D boundingBox()
        Returns the bounding box of this linear curve.
        Specified by:
        boundingBox in interface Shape2D
        Returns:
        the bounding box of the shape.
      • contains

        public boolean contains(double x,
                                double y)
        Description copied from interface: Shape2D
        Checks if the shape contains the planar point defined by (x,y).
        Specified by:
        contains in interface Shape2D
      • contains

        public boolean contains(Point2D point)
        Description copied from interface: Shape2D
        Checks if the shape contains the given point.
        Specified by:
        contains in interface Shape2D
      • asGeneralPath

        public java.awt.geom.GeneralPath asGeneralPath()
        Returns a general path iterator.
      • draw

        public void draw(java.awt.Graphics2D g2)
        Description copied from interface: Curve2D
        Draws the curve on the given Graphics2D object.
        Specified by:
        draw in interface Curve2D
        Specified by:
        draw in interface Shape2D
        Overrides:
        draw in class AbstractContinuousCurve2D
        Parameters:
        g2 - the graphics to draw the curve in

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.