Interface Segment2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>

  • Type Parameters:
    ST - is the type of the general implementation.
    IT - is the type of the implementation of this shape.
    IE - is the type of the path elements.
    P - is the type of the points.
    V - is the type of the vectors.
    B - is the type of the bounding boxes.
    All Superinterfaces:
    Cloneable, JsonableObject, Serializable, Shape2afp<ST,​IT,​IE,​P,​V,​B>, Shape2D<ST,​IT,​PathIterator2afp<IE>,​P,​V,​B>
    All Known Implementing Classes:
    Segment2d, Segment2dfx, SegmentPoint2d

    public interface Segment2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
    extends Shape2afp<ST,​IT,​IE,​P,​V,​B>
    Fonctional interface that represented a 2D segment/line on a plane.
    Version:
    17.0 2020-01-04 14:41:43
    Author:
    Stéphane GALLAND, Hamza JAFFALI
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    mathgeom
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      static int calculatesCrossingsCircleShadowSegment​(int crossings, double cx, double cy, double radius, double x0, double y0, double x1, double y1)
      Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the circle (cx, cy) with radius extending to the right.
      static int calculatesCrossingsEllipseShadowSegment​(int crossings, double ex, double ey, double ew, double eh, double x0, double y0, double x1, double y1)
      Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the ellipse (ex0, ey0) to (ex1, ey1) extending to the right.
      static int calculatesCrossingsPointShadowSegment​(double px, double py, double x0, double y0, double x1, double y1)
      Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the ray extending to the right from (px, py).
      static int calculatesCrossingsPointShadowSegmentWithoutEquality​(double px, double py, double x0, double y0, double x1, double y1)
      Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the ray extending to the right from (px, py).
      static int calculatesCrossingsRectangleShadowSegment​(int crossings, double rxmin, double rymin, double rxmax, double rymax, double x0, double y0, double x1, double y1)
      Accumulate the number of times the line crosses the shadow extending to the right of the rectangle.
      static int calculatesCrossingsRoundRectangleShadowSegment​(int crossings, double rxmin, double rymin, double rxmax, double rymax, double arcWidth, double arcHeight, double x0, double y0, double x1, double y1)
      Accumulate the number of times the line crosses the shadow extending to the right of the round rectangle.
      static int calculatesCrossingsSegmentShadowSegment​(int crossings, double sx1, double sy1, double sx2, double sy2, double x0, double y0, double x1, double y1)
      Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the segment (sx0, sy0) to (sx1, sy1) extending to the right.
      static int calculatesCrossingsTriangleShadowSegment​(int crossings, double tx1, double ty1, double tx2, double ty2, double tx3, double ty3, double x0, double y0, double x1, double y1)
      Accumulate the number of times the line crosses the shadow extending to the right of the triangle.
      static double calculatesDistanceLinePoint​(double x1, double y1, double x2, double y2, double px, double py)
      Compute the distance between a point and a line.
      static double calculatesDistanceSegmentPoint​(double x1, double y1, double x2, double y2, double px, double py)
      Compute the distance between a point and a segment.
      static double calculatesDistanceSquaredLinePoint​(double x1, double y1, double x2, double y2, double px, double py)
      Compute the distance between a point and a line.
      static double calculatesDistanceSquaredSegmentPoint​(double x1, double y1, double x2, double y2, double px, double py)
      Compute the square distance between a point and a segment.
      static double calculatesDistanceSquaredSegmentSegment​(double s1x1, double s1y1, double s1x2, double s1y2, double s2x1, double s2y1, double s2x2, double s2y2)
      Replies the distance between the two segments.
      static double calculatesLineLineIntersectionFactor​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Replies the position factory for the intersection point between two lines.
      static double calculatesRelativeDistanceLinePoint​(double x1, double y1, double x2, double y2, double px, double py)
      Replies the relative distance from the given point to the given line.
      static double calculatesSegmentSegmentIntersectionFactor​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Replies one position factor for the intersection point between two lines.
      static int ccw​(double x1, double y1, double x2, double y2, double px, double py, double epsilon)
      Replies the relative counterclockwise (CCW) of a segment against a point.
      default void clear()
      Reset this shape to be equivalent to an just-created instance of this shape type.
      default boolean clipToRectangle​(double rxmin, double rymin, double rxmax, double rymax)
      Clip the segment against the clipping rectangle according to the Cohen-Sutherland algorithm.
      default boolean contains​(double x, double y)
      Replies if the given point is inside this shape.
      default boolean contains​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
      Replies if the given rectangle is inside this shape.
      default boolean contains​(Shape2D<?,​?,​?,​?,​?,​?> shape)
      Replies if this shape is inside the given shape.
      default boolean equalsToShape​(IT shape)
      Replies this shape is equal to the given shape.
      static void findsClosestPointSegmentPoint​(double ax, double ay, double bx, double by, double px, double py, Point2D<?,​?> result)
      Replies the point on the segment that is closest to the given point.
      static void findsClosestPointSegmentRectangle​(double sx1, double sy1, double sx2, double sy2, double rx, double ry, double rwidth, double rheight, Point2D<?,​?> result)
      Replies the point on the segment that is closest to the rectangle.
      static double findsClosestPointSegmentSegment​(double s1x1, double s1y1, double s1x2, double s1y2, double s2x1, double s2y1, double s2x2, double s2y2, Point2D<?,​?> result)
      Replies the point on the first segment that is closest to the second segment.
      static double findsClosestPointSegmentSegment​(double s1x1, double s1y1, double s1x2, double s1y2, double s2x1, double s2y1, double s2x2, double s2y2, Point2D<?,​?> resultOnFirstSegment, Point2D<?,​?> resultOnSecondSegment)
      Replies the point on the first segment that is closest to the second segment.
      static void findsFarthestPointSegmentPoint​(double ax, double ay, double bx, double by, double px, double py, Point2D<?,​?> result)
      Replies the point on the segment that is farthest to the given point.
      static void findsFarthestPointSegmentRectangle​(double sx1, double sy1, double sx2, double sy2, double rx, double ry, double rwidth, double rheight, Point2D<?,​?> result)
      Replies the point on the segment that is farthest to the rectangle.
      static double findsFarthestPointSegmentSegment​(double s1x1, double s1y1, double s1x2, double s1y2, double s2x1, double s2y1, double s2x2, double s2y2, Point2D<?,​?> result)
      Replies the point on the first segment that is farthest to the second segment.
      static boolean findsLineLineIntersection​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, Point2D<?,​?> result)
      Compute the intersection of two lines specified by the specified points and vectors.
      static double findsProjectedPointPointLine​(double px, double py, double s1x, double s1y, double s2x, double s2y)
      Replies the projection a point on a segment.
      static boolean findsSegmentSegmentIntersection​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4, Point2D<?,​?> result)
      Replies the intersection point between two segments.
      static int findsSideLinePoint​(double x1, double y1, double x2, double y2, double px, double py, double epsilon)
      } Replies on which side of a line the given point is located.
      static Segment2afp.UncertainIntersection findsUncertainIntersectionSegmentSegmentWithEnds​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Do an intersection test of two segments for ensuring that the answer of "no intersect" is safe.
      static Segment2afp.UncertainIntersection findsUncertainIntersectionSegmentSegmentWithoutEnds​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Do an intersection test of two segments for ensuring that the answer of "no intersect" is safe.
      default P getClosestPointTo​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
      Replies the closest point on this shape to the given circle.
      default P getClosestPointTo​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
      Replies the closest point on this shape to the given ellipse.
      default P getClosestPointTo​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectngle)
      Replies the closest point on this shape to the given oriented rectangle.
      default P getClosestPointTo​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
      Replies the closest point on this shape to the given parallelogram.
      default P getClosestPointTo​(Path2afp<?,​?,​?,​?,​?,​?> path)
      Replies the closest point on this shape to the given path.
      default P getClosestPointTo​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
      Replies the closest point on this shape to the given rectangle.
      default P getClosestPointTo​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
      Replies the closest point on this shape to the given round rectangle.
      default P getClosestPointTo​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
      Replies the closest point on this shape to the given segment.
      default P getClosestPointTo​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
      Replies the closest point on this shape to the given triangle.
      default P getClosestPointTo​(Point2D<?,​?> pt)
      Replies the point on the shape that is closest to the given point.
      default double getDistanceL1​(Point2D<?,​?> pt)
      Computes the L-1 (Manhattan) distance between this shape and point p1.
      default double getDistanceLinf​(Point2D<?,​?> pt)
      Computes the L-infinite distance between this shape and point p1.
      default double getDistanceSquared​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
      Replies the minimum distance between this shape and the given segment.
      default double getDistanceSquared​(Point2D<?,​?> pt)
      Replies the squared value of the minimal distance from this shape to the given point.
      default P getFarthestPointTo​(Point2D<?,​?> pt)
      Replies the point on the shape that is farthest the given point.
      default double getLength()
      Replies the length of the segment.
      default double getLengthSquared()
      Replies the squared length of the segment.
      default P getP1()
      Replies the first point.
      default P getP2()
      Replies the second point.
      default PathIterator2afp<IE> getPathIterator​(Transform2D transform)
      Replies the elements of the paths.
      double getX1()
      Replies the X of the first point.
      double getX2()
      Replies the X of the second point.
      double getY1()
      Replies the Y of the first point.
      double getY2()
      Replies the Y of the second point.
      static void interpolates​(double p1x, double p1y, double p2x, double p2y, double factor, Point2D<?,​?> result)
      Compute the interpolate point between the two points.
      default boolean intersects​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
      Replies if this shape is intersecting the given circle.
      default boolean intersects​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
      Replies if this shape is intersecting the given ellipse.
      default boolean intersects​(MultiShape2afp<?,​?,​?,​?,​?,​?,​?> multishape)
      Replies if this shape is intersecting the given multishape.
      default boolean intersects​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
      Replies if this shape is intersecting the given rectangle.
      default boolean intersects​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
      Replies if this shape is intersecting the given parallelogram.
      default boolean intersects​(PathIterator2afp<?> iterator)
      Replies if this shape is intersecting the shape representing the given path iterator.
      default boolean intersects​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
      Replies if this shape is intersecting the given rectangle.
      default boolean intersects​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
      Replies if this shape is intersecting the given rectangle.
      default boolean intersects​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
      Replies if this shape is intersecting the given line.
      default boolean intersects​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
      Replies if this shape is intersecting the given triangle.
      static boolean intersectsLineLine​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Replies if two lines are intersecting.
      static boolean intersectsSegmentLine​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Replies if a segment and a line are intersecting.
      static boolean intersectsSegmentSegmentWithEnds​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Replies if two segments are intersecting.
      static boolean intersectsSegmentSegmentWithoutEnds​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Replies if two segments are intersecting.
      static boolean isCollinearLines​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Replies if two lines are colinear.
      default boolean isEmpty()
      Replies if this shape is empty.
      static boolean isParallelLines​(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
      Replies if two lines are parallel.
      static boolean isPointClosedToLine​(double x1, double y1, double x2, double y2, double x, double y, double hitDistance)
      Replies if a point is closed to a line.
      static boolean isPointClosedToSegment​(double x1, double y1, double x2, double y2, double x, double y, double hitDistance)
      Replies if a point is closed to a segment.
      void set​(double x1, double y1, double x2, double y2)
      Change the line.
      default void set​(IT shape)
      Set this shape with the attributes of the given shape.
      default void set​(Point2D<?,​?> firstPoint, Point2D<?,​?> secondPoint)
      Change the line.
      default void setP1​(double x, double y)
      Change the first point.
      default void setP1​(Point2D<?,​?> pt)
      Change the first point.
      default void setP2​(double x, double y)
      Change the second point.
      default void setP2​(Point2D<?,​?> pt)
      Change the second point.
      void setX1​(double x)
      Sets a new value in the X of the first point.
      void setX2​(double x)
      Sets a new value in the X of the second point.
      void setY1​(double y)
      Sets a new value in the Y of the first point.
      void setY2​(double y)
      Sets a new value in the Y of the second point.
      default void toBoundingBox​(B box)
      Replies the bounds of the shape.
      default void transform​(Transform2D transform)
      Transform the current segment.
      default void translate​(double dx, double dy)
      Translate the shape.
    • Method Detail

      • ccw

        @Pure
        static int ccw​(double x1,
                       double y1,
                       double x2,
                       double y2,
                       double px,
                       double py,
                       double epsilon)
        Replies the relative counterclockwise (CCW) of a segment against a point. Returns an indicator of where the specified point (px, py) lies with respect to the line segment from (x1, y1) to (x2, y2). The return value can be either 1, -1, or 0 and indicates in which direction the specified line must pivot around its first end point, (x1, y1), in order to point at the specified point (px, py). In other words, given three point P1, P2, and P, is the segments (P1-P2-P) a counterclockwise turn?

        In opposite to findsSideLinePoint(double, double, double, double, double, double, double), this function tries to classifies the point if it is colinear to the segment. The classification is explained below.

        A return value of 1 indicates that the line segment must turn in the direction that takes the positive X axis towards the negative Y axis. In the default coordinate system used by Java 2D, this direction is counterclockwise.

        A return value of -1 indicates that the line segment must turn in the direction that takes the positive X axis towards the positive Y axis. In the default coordinate system, this direction is clockwise.

        A return value of 0 indicates that the point lies exactly on the line segment. Note that an indicator value of 0 is rare and not useful for determining colinearity because of floating point rounding issues.

        If the point is colinear with the line segment, but not between the end points, then the value will be -1 if the point lies "beyond (x1, y1)" or 1 if the point lies "beyond (x2, y2)".

        Parameters:
        x1 - the X coordinate of the start point of the specified line segment
        y1 - the Y coordinate of the start point of the specified line segment
        x2 - the X coordinate of the end point of the specified line segment
        y2 - the Y coordinate of the end point of the specified line segment
        px - the X coordinate of the specified point to be compared with the specified line segment
        py - the Y coordinate of the specified point to be compared with the specified line segment
        epsilon - approximation of the tests for equality to zero.
        Returns:
        an integer that indicates the position of the third specified coordinates with respect to the line segment formed by the first two specified coordinates.
        See Also:
        calculatesRelativeDistanceLinePoint(double, double, double, double, double, double), findsSideLinePoint(double, double, double, double, double, double, double)
      • findsClosestPointSegmentPoint

        static void findsClosestPointSegmentPoint​(double ax,
                                                  double ay,
                                                  double bx,
                                                  double by,
                                                  double px,
                                                  double py,
                                                  Point2D<?,​?> result)
        Replies the point on the segment that is closest to the given point.
        Parameters:
        ax - is the x coordinate of the first point of the segment.
        ay - is the y coordinate of the first point of the segment.
        bx - is the x coordinate of the second point of the segment.
        by - is the y coordinate of the second point of the segment.
        px - is the x coordinate of the point.
        py - is the y coordinate of the point.
        result - the is point on the shape.
      • findsClosestPointSegmentRectangle

        static void findsClosestPointSegmentRectangle​(double sx1,
                                                      double sy1,
                                                      double sx2,
                                                      double sy2,
                                                      double rx,
                                                      double ry,
                                                      double rwidth,
                                                      double rheight,
                                                      Point2D<?,​?> result)
        Replies the point on the segment that is closest to the rectangle.
        Parameters:
        sx1 - is the x coordinate of the first point of the segment.
        sy1 - is the y coordinate of the first point of the segment.
        sx2 - is the x coordinate of the second point of the segment.
        sy2 - is the y coordinate of the second point of the segment.
        rx - is the x coordinate of the rectangle.
        ry - is the y coordinate of the rectangle.
        rwidth - is the width of the rectangle.
        rheight - is the height of the rectangle.
        result - the is point on the segment.
      • findsClosestPointSegmentSegment

        static double findsClosestPointSegmentSegment​(double s1x1,
                                                      double s1y1,
                                                      double s1x2,
                                                      double s1y2,
                                                      double s2x1,
                                                      double s2y1,
                                                      double s2x2,
                                                      double s2y2,
                                                      Point2D<?,​?> result)
        Replies the point on the first segment that is closest to the second segment.
        Parameters:
        s1x1 - is the x coordinate of the first point of the first segment.
        s1y1 - is the y coordinate of the first point of the first segment.
        s1x2 - is the x coordinate of the second point of the first segment.
        s1y2 - is the y coordinate of the second point of the first segment.
        s2x1 - is the x coordinate of the first point of the second segment.
        s2y1 - is the y coordinate of the first point of the second segment.
        s2x2 - is the x coordinate of the second point of the second segment.
        s2y2 - is the y coordinate of the second point of the second segment.
        result - the is point on the shape.
        Returns:
        the square distance between the segments.
      • findsClosestPointSegmentSegment

        static double findsClosestPointSegmentSegment​(double s1x1,
                                                      double s1y1,
                                                      double s1x2,
                                                      double s1y2,
                                                      double s2x1,
                                                      double s2y1,
                                                      double s2x2,
                                                      double s2y2,
                                                      Point2D<?,​?> resultOnFirstSegment,
                                                      Point2D<?,​?> resultOnSecondSegment)
        Replies the point on the first segment that is closest to the second segment.
        Parameters:
        s1x1 - is the x coordinate of the first point of the first segment.
        s1y1 - is the y coordinate of the first point of the first segment.
        s1x2 - is the x coordinate of the second point of the first segment.
        s1y2 - is the y coordinate of the second point of the first segment.
        s2x1 - is the x coordinate of the first point of the second segment.
        s2y1 - is the y coordinate of the first point of the second segment.
        s2x2 - is the x coordinate of the second point of the second segment.
        s2y2 - is the y coordinate of the second point of the second segment.
        resultOnFirstSegment - the point on the first segment.
        resultOnSecondSegment - the point on the second segment.
        Returns:
        the square distance between the segments.
      • calculatesCrossingsCircleShadowSegment

        @Pure
        static int calculatesCrossingsCircleShadowSegment​(int crossings,
                                                          double cx,
                                                          double cy,
                                                          double radius,
                                                          double x0,
                                                          double y0,
                                                          double x1,
                                                          double y1)
        Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the circle (cx, cy) with radius extending to the right.
        Parameters:
        crossings - is the initial value for the number of crossings.
        cx - is the center of the circle to extend.
        cy - is the center of the circle to extend.
        radius - is the radius of the circle to extend.
        x0 - is the first point of the line.
        y0 - is the first point of the line.
        x1 - is the second point of the line.
        y1 - is the secondpoint of the line.
        Returns:
        the crossing, or GeomConstants.SHAPE_INTERSECTS.
      • calculatesCrossingsEllipseShadowSegment

        @Pure
        static int calculatesCrossingsEllipseShadowSegment​(int crossings,
                                                           double ex,
                                                           double ey,
                                                           double ew,
                                                           double eh,
                                                           double x0,
                                                           double y0,
                                                           double x1,
                                                           double y1)
        Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the ellipse (ex0, ey0) to (ex1, ey1) extending to the right.
        Parameters:
        crossings - is the initial value for the number of crossings.
        ex - is the first corner of the ellipse to extend.
        ey - is the first corner of the ellipse to extend.
        ew - is the width of the ellipse to extend.
        eh - is the height of the ellipse to extend.
        x0 - is the first point of the line.
        y0 - is the first point of the line.
        x1 - is the second point of the line.
        y1 - is the secondpoint of the line.
        Returns:
        the crossing, or GeomConstants.SHAPE_INTERSECTS.
      • calculatesCrossingsPointShadowSegment

        @Pure
        static int calculatesCrossingsPointShadowSegment​(double px,
                                                         double py,
                                                         double x0,
                                                         double y0,
                                                         double x1,
                                                         double y1)
        Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the ray extending to the right from (px, py). If the point lies on the line, then no crossings are recorded. +1 is returned for a crossing where the Y coordinate is increasing -1 is returned for a crossing where the Y coordinate is decreasing

        This function differs from calculatesCrossingsPointShadowSegmentWithoutEquality(double, double, double, double, double, double). The equality test is used in this function.

        Parameters:
        px - is the reference point to test.
        py - is the reference point to test.
        x0 - is the first point of the line.
        y0 - is the first point of the line.
        x1 - is the second point of the line.
        y1 - is the secondpoint of the line.
        Returns:
        the crossing.
      • calculatesCrossingsPointShadowSegmentWithoutEquality

        @Pure
        static int calculatesCrossingsPointShadowSegmentWithoutEquality​(double px,
                                                                        double py,
                                                                        double x0,
                                                                        double y0,
                                                                        double x1,
                                                                        double y1)
        Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the ray extending to the right from (px, py). If the point lies on the line, then no crossings are recorded. +1 is returned for a crossing where the Y coordinate is increasing -1 is returned for a crossing where the Y coordinate is decreasing

        This function differs from calculatesCrossingsPointShadowSegment(double, double, double, double, double, double). The equality test is not used in this function.

        Parameters:
        px - is the reference point to test.
        py - is the reference point to test.
        x0 - is the first point of the line.
        y0 - is the first point of the line.
        x1 - is the second point of the line.
        y1 - is the secondpoint of the line.
        Returns:
        the crossing.
      • calculatesCrossingsRectangleShadowSegment

        @Pure
        static int calculatesCrossingsRectangleShadowSegment​(int crossings,
                                                             double rxmin,
                                                             double rymin,
                                                             double rxmax,
                                                             double rymax,
                                                             double x0,
                                                             double y0,
                                                             double x1,
                                                             double y1)
        Accumulate the number of times the line crosses the shadow extending to the right of the rectangle. See the comment for the GeomConstants.SHAPE_INTERSECTS constant for more complete details.
        Parameters:
        crossings - is the initial value for the number of crossings.
        rxmin - is the first corner of the rectangle.
        rymin - is the first corner of the rectangle.
        rxmax - is the second corner of the rectangle.
        rymax - is the second corner of the rectangle.
        x0 - is the first point of the line.
        y0 - is the first point of the line.
        x1 - is the second point of the line.
        y1 - is the secondpoint of the line.
        Returns:
        the crossing, or GeomConstants.SHAPE_INTERSECTS.
      • calculatesCrossingsRoundRectangleShadowSegment

        @Pure
        static int calculatesCrossingsRoundRectangleShadowSegment​(int crossings,
                                                                  double rxmin,
                                                                  double rymin,
                                                                  double rxmax,
                                                                  double rymax,
                                                                  double arcWidth,
                                                                  double arcHeight,
                                                                  double x0,
                                                                  double y0,
                                                                  double x1,
                                                                  double y1)
        Accumulate the number of times the line crosses the shadow extending to the right of the round rectangle. See the comment for the GeomConstants.SHAPE_INTERSECTS constant for more complete details.
        Parameters:
        crossings - is the initial value for the number of crossings.
        rxmin - is the first corner of the rectangle.
        rymin - is the first corner of the rectangle.
        rxmax - is the second corner of the rectangle.
        rymax - is the second corner of the rectangle.
        arcWidth - is the width of the rectangle arcs.
        arcHeight - is the height of the rectangle arcs.
        x0 - is the first point of the line.
        y0 - is the first point of the line.
        x1 - is the second point of the line.
        y1 - is the secondpoint of the line.
        Returns:
        the crossing, or GeomConstants.SHAPE_INTERSECTS.
      • calculatesCrossingsSegmentShadowSegment

        @Pure
        static int calculatesCrossingsSegmentShadowSegment​(int crossings,
                                                           double sx1,
                                                           double sy1,
                                                           double sx2,
                                                           double sy2,
                                                           double x0,
                                                           double y0,
                                                           double x1,
                                                           double y1)
        Calculates the number of times the line from (x0, y0) to (x1, y1) crosses the segment (sx0, sy0) to (sx1, sy1) extending to the right.
        Parameters:
        crossings - is the initial value for the number of crossings.
        sx1 - is the first point of the segment to extend.
        sy1 - is the first point of the segment to extend.
        sx2 - is the second point of the segment to extend.
        sy2 - is the second point of the segment to extend.
        x0 - is the first point of the line.
        y0 - is the first point of the line.
        x1 - is the second point of the line.
        y1 - is the secondpoint of the line.
        Returns:
        the crossing, or GeomConstants.SHAPE_INTERSECTS
      • calculatesCrossingsTriangleShadowSegment

        @Pure
        static int calculatesCrossingsTriangleShadowSegment​(int crossings,
                                                            double tx1,
                                                            double ty1,
                                                            double tx2,
                                                            double ty2,
                                                            double tx3,
                                                            double ty3,
                                                            double x0,
                                                            double y0,
                                                            double x1,
                                                            double y1)
        Accumulate the number of times the line crosses the shadow extending to the right of the triangle. See the comment for the GeomConstants.SHAPE_INTERSECTS constant for more complete details.
        Parameters:
        crossings - is the initial value for the number of crossings.
        tx1 - is the first point of the triangle.
        ty1 - is the first point of the triangle.
        tx2 - is the second point of the triangle.
        ty2 - is the second point of the triangle.
        tx3 - is the third point of the triangle.
        ty3 - is the third point of the triangle.
        x0 - is the first point of the line.
        y0 - is the first point of the line.
        x1 - is the second point of the line.
        y1 - is the secondpoint of the line.
        Returns:
        the crossing, or GeomConstants.SHAPE_INTERSECTS.
      • calculatesDistanceSegmentPoint

        @Pure
        static double calculatesDistanceSegmentPoint​(double x1,
                                                     double y1,
                                                     double x2,
                                                     double y2,
                                                     double px,
                                                     double py)
        Compute the distance between a point and a segment.
        Parameters:
        x1 - horizontal position of the first point of the segment.
        y1 - vertical position of the first point of the segment.
        x2 - horizontal position of the second point of the segment.
        y2 - vertical position of the second point of the segment.
        px - horizontal position of the point.
        py - vertical position of the point.
        Returns:
        the distance beetween the point and the segment.
      • calculatesDistanceSquaredLinePoint

        @Pure
        static double calculatesDistanceSquaredLinePoint​(double x1,
                                                         double y1,
                                                         double x2,
                                                         double y2,
                                                         double px,
                                                         double py)
        Compute the distance between a point and a line.
        Parameters:
        x1 - horizontal position of the first point of the line.
        y1 - vertical position of the first point of the line.
        x2 - horizontal position of the second point of the line.
        y2 - vertical position of the second point of the line.
        px - horizontal position of the point.
        py - vertical position of the point.
        Returns:
        the distance beetween the point and the line.
        See Also:
        calculatesDistanceLinePoint(double, double, double, double, double, double)
      • calculatesDistanceSquaredSegmentPoint

        @Pure
        static double calculatesDistanceSquaredSegmentPoint​(double x1,
                                                            double y1,
                                                            double x2,
                                                            double y2,
                                                            double px,
                                                            double py)
        Compute the square distance between a point and a segment.
        Parameters:
        x1 - horizontal position of the first point of the segment.
        y1 - vertical position of the first point of the segment.
        x2 - horizontal position of the second point of the segment.
        y2 - vertical position of the second point of the segment.
        px - horizontal position of the point.
        py - vertical position of the point.
        Returns:
        the distance beetween the point and the segment.
      • calculatesDistanceSquaredSegmentSegment

        @Pure
        static double calculatesDistanceSquaredSegmentSegment​(double s1x1,
                                                              double s1y1,
                                                              double s1x2,
                                                              double s1y2,
                                                              double s2x1,
                                                              double s2y1,
                                                              double s2x2,
                                                              double s2y2)
        Replies the distance between the two segments.
        Parameters:
        s1x1 - x coordinate of the first point of the first triangle.
        s1y1 - y coordinate of the first point of the first triangle.
        s1x2 - x coordinate of the second point of the first triangle.
        s1y2 - y coordinate of the second point of the first triangle.
        s2x1 - x coordinate of the first point of the second triangle.
        s2y1 - y coordinate of the first point of the second triangle.
        s2x2 - x coordinate of the second point of the second triangle.
        s2y2 - y coordinate of the second point of the second triangle.
        Returns:
        the distance between the two segments.
      • findsFarthestPointSegmentPoint

        static void findsFarthestPointSegmentPoint​(double ax,
                                                   double ay,
                                                   double bx,
                                                   double by,
                                                   double px,
                                                   double py,
                                                   Point2D<?,​?> result)
        Replies the point on the segment that is farthest to the given point.
        Parameters:
        ax - is the x coordinate of the first point of the segment.
        ay - is the y coordinate of the first point of the segment.
        bx - is the x coordinate of the second point of the segment.
        by - is the y coordinate of the second point of the segment.
        px - is the x coordinate of the point.
        py - is the y coordinate of the point.
        result - the farthest point on the shape.
      • findsFarthestPointSegmentRectangle

        static void findsFarthestPointSegmentRectangle​(double sx1,
                                                       double sy1,
                                                       double sx2,
                                                       double sy2,
                                                       double rx,
                                                       double ry,
                                                       double rwidth,
                                                       double rheight,
                                                       Point2D<?,​?> result)
        Replies the point on the segment that is farthest to the rectangle.
        Parameters:
        sx1 - is the x coordinate of the first point of the segment.
        sy1 - is the y coordinate of the first point of the segment.
        sx2 - is the x coordinate of the second point of the segment.
        sy2 - is the y coordinate of the second point of the segment.
        rx - is the x coordinate of the rectangle.
        ry - is the y coordinate of the rectangle.
        rwidth - is the width of the rectangle.
        rheight - is the height of the rectangle.
        result - the is point on the segment.
      • findsFarthestPointSegmentSegment

        static double findsFarthestPointSegmentSegment​(double s1x1,
                                                       double s1y1,
                                                       double s1x2,
                                                       double s1y2,
                                                       double s2x1,
                                                       double s2y1,
                                                       double s2x2,
                                                       double s2y2,
                                                       Point2D<?,​?> result)
        Replies the point on the first segment that is farthest to the second segment.
        Parameters:
        s1x1 - is the x coordinate of the first point of the first segment.
        s1y1 - is the y coordinate of the first point of the first segment.
        s1x2 - is the x coordinate of the second point of the first segment.
        s1y2 - is the y coordinate of the second point of the first segment.
        s2x1 - is the x coordinate of the first point of the second segment.
        s2y1 - is the y coordinate of the first point of the second segment.
        s2x2 - is the x coordinate of the second point of the second segment.
        s2y2 - is the y coordinate of the second point of the second segment.
        result - the is point on the shape.
        Returns:
        the minimal square distance between the point on the first segment and any point on the second segment.
      • findsLineLineIntersection

        static boolean findsLineLineIntersection​(double x1,
                                                 double y1,
                                                 double x2,
                                                 double y2,
                                                 double x3,
                                                 double y3,
                                                 double x4,
                                                 double y4,
                                                 Point2D<?,​?> result)
        Compute the intersection of two lines specified by the specified points and vectors.
        Parameters:
        x1 - horizontal position of the first point of the line.
        y1 - vertical position of the first point of the line.
        x2 - horizontal position of the second point of the line.
        y2 - vertical position of the second point of the line.
        x3 - horizontal position of the first point of the line.
        y3 - vertical position of the first point of the line.
        x4 - horizontal position of the second point of the line.
        y4 - vertical position of the second point of the line.
        result - the intersection point.
        Returns:
        true if there is an intersection.
      • calculatesLineLineIntersectionFactor

        @Pure
        static double calculatesLineLineIntersectionFactor​(double x1,
                                                           double y1,
                                                           double x2,
                                                           double y2,
                                                           double x3,
                                                           double y3,
                                                           double x4,
                                                           double y4)
        Replies the position factory for the intersection point between two lines.

        Let line equations for L1 and L2:
        L1: P1 + factor1 * (P2-P1)
        L2: P3 + factor2 * (P4-P3)
        If lines are intersecting, then
        P1 + factor1 * (P2-P1) = P3 + factor2 * (P4-P3)

        This function computes and replies factor1.

        Parameters:
        x1 - is the X coordinate of the first point of the first line.
        y1 - is the Y coordinate of the first point of the first line.
        x2 - is the X coordinate of the second point of the first line.
        y2 - is the Y coordinate of the second point of the first line.
        x3 - is the X coordinate of the first point of the second line.
        y3 - is the Y coordinate of the first point of the second line.
        x4 - is the X coordinate of the second point of the second line.
        y4 - is the Y coordinate of the second point of the second line.
        Returns:
        factor1 or Double.NaN if no intersection.
      • findsProjectedPointPointLine

        @Pure
        static double findsProjectedPointPointLine​(double px,
                                                   double py,
                                                   double s1x,
                                                   double s1y,
                                                   double s2x,
                                                   double s2y)
        Replies the projection a point on a segment.
        Parameters:
        px - is the coordinate of the point to project
        py - is the coordinate of the point to project
        s1x - is the x-coordinate of the first line point.
        s1y - is the y-coordinate of the first line point.
        s2x - is the x-coordinate of the second line point.
        s2y - is the y-coordinate of the second line point.
        Returns:
        the projection of the specified point on the line. If equal to 0, the projection is equal to the first segment point. If equal to 1, the projection is equal to the second segment point. If inside ]0;1[, the projection is between the two segment points. If inside ]-inf;0[, the projection is outside on the side of the first segment point. If inside ]1;+inf[, the projection is outside on the side of the second segment point.
      • calculatesRelativeDistanceLinePoint

        @Pure
        static double calculatesRelativeDistanceLinePoint​(double x1,
                                                          double y1,
                                                          double x2,
                                                          double y2,
                                                          double px,
                                                          double py)
        Replies the relative distance from the given point to the given line. The replied distance may be negative, depending on which side of the line the point is.
        Parameters:
        x1 - the X coordinate of the start point of the specified line segment
        y1 - the Y coordinate of the start point of the specified line segment
        x2 - the X coordinate of the end point of the specified line segment
        y2 - the Y coordinate of the end point of the specified line segment
        px - the X coordinate of the specified point to be compared with the specified line segment
        py - the Y coordinate of the specified point to be compared with the specified line segment
        Returns:
        the positive or negative distance from the point to the line
        See Also:
        ccw(double, double, double, double, double, double, double), findsSideLinePoint(double, double, double, double, double, double, double)
      • findsSegmentSegmentIntersection

        static boolean findsSegmentSegmentIntersection​(double x1,
                                                       double y1,
                                                       double x2,
                                                       double y2,
                                                       double x3,
                                                       double y3,
                                                       double x4,
                                                       double y4,
                                                       Point2D<?,​?> result)
        Replies the intersection point between two segments.
        Parameters:
        x1 - is the X coordinate of the first point of the first segment.
        y1 - is the Y coordinate of the first point of the first segment.
        x2 - is the X coordinate of the second point of the first segment.
        y2 - is the Y coordinate of the second point of the first segment.
        x3 - is the X coordinate of the first point of the second segment.
        y3 - is the Y coordinate of the first point of the second segment.
        x4 - is the X coordinate of the second point of the second segment.
        y4 - is the Y coordinate of the second point of the second segment.
        result - the intersection point.
        Returns:
        true if an intersection exists.
      • calculatesSegmentSegmentIntersectionFactor

        @Pure
        static double calculatesSegmentSegmentIntersectionFactor​(double x1,
                                                                 double y1,
                                                                 double x2,
                                                                 double y2,
                                                                 double x3,
                                                                 double y3,
                                                                 double x4,
                                                                 double y4)
        Replies one position factor for the intersection point between two lines.

        Let line equations for L1 and L2:
        L1: P1 + factor1 * (P2-P1)
        L2: P3 + factor2 * (P4-P3)
        If lines are intersecting, then
        P1 + factor1 * (P2-P1) = P3 + factor2 * (P4-P3)

        This function computes and replies factor1.

        Parameters:
        x1 - is the X coordinate of the first point of the first segment.
        y1 - is the Y coordinate of the first point of the first segment.
        x2 - is the X coordinate of the second point of the first segment.
        y2 - is the Y coordinate of the second point of the first segment.
        x3 - is the X coordinate of the first point of the second segment.
        y3 - is the Y coordinate of the first point of the second segment.
        x4 - is the X coordinate of the second point of the second segment.
        y4 - is the Y coordinate of the second point of the second segment.
        Returns:
        factor1 or Double.NaN if no intersection.
      • findsSideLinePoint

        @Pure
        static int findsSideLinePoint​(double x1,
                                      double y1,
                                      double x2,
                                      double y2,
                                      double px,
                                      double py,
                                      double epsilon)
        } Replies on which side of a line the given point is located.

        A return value of 1 indicates that the line segment must turn in the direction that takes the positive X axis towards the negative Y axis. In the default coordinate system used by Java 2D, this direction is counterclockwise.

        A return value of -1 indicates that the line segment must turn in the direction that takes the positive X axis towards the positive Y axis. In the default coordinate system, this direction is clockwise.

        A return value of 0 indicates that the point lies exactly on the line segment. Note that an indicator value of 0 is rare and not useful for determining colinearity because of floating point rounding issues.

        This function uses the equal-to-zero test with the error Math.ulp(double).

        In opposite of ccw(double, double, double, double, double, double, double), this function does not try to classify the point if it is colinear to the segment. If the point is colinear, O is always returns.

        Parameters:
        x1 - the X coordinate of the start point of the specified line segment
        y1 - the Y coordinate of the start point of the specified line segment
        x2 - the X coordinate of the end point of the specified line segment
        y2 - the Y coordinate of the end point of the specified line segment
        px - the X coordinate of the specified point to be compared with the specified line segment
        py - the Y coordinate of the specified point to be compared with the specified line segment
        epsilon - approximate epsilon.
        Returns:
        an integer that indicates the position of the third specified coordinates with respect to the line segment formed by the first two specified coordinates.
        See Also:
        calculatesRelativeDistanceLinePoint(double, double, double, double, double, double), MathUtil.isEpsilonZero(double), ccw(double, double, double, double, double, double, double)
      • findsUncertainIntersectionSegmentSegmentWithEnds

        @Pure
        static Segment2afp.UncertainIntersection findsUncertainIntersectionSegmentSegmentWithEnds​(double x1,
                                                                                                  double y1,
                                                                                                  double x2,
                                                                                                  double y2,
                                                                                                  double x3,
                                                                                                  double y3,
                                                                                                  double x4,
                                                                                                  double y4)
        Do an intersection test of two segments for ensuring that the answer of "no intersect" is safe.

        If the function replies Segment2afp.UncertainIntersection.NO, we are sure that the two given segments are not intersecting. If the function replies Segment2afp.UncertainIntersection.PERHAPS, the two segments may intersects (uncertain answer).

        This function considers that the ends of the segments are intersecting.

        Parameters:
        x1 - is the first point of the first segment.
        y1 - is the first point of the first segment.
        x2 - is the second point of the first segment.
        y2 - is the second point of the first segment.
        x3 - is the first point of the second segment.
        y3 - is the first point of the second segment.
        x4 - is the second point of the second segment.
        y4 - is the second point of the second segment.
        Returns:
        the type of intersection.
        See Also:
        intersectsSegmentSegmentWithEnds(double, double, double, double, double, double, double, double)
      • findsUncertainIntersectionSegmentSegmentWithoutEnds

        @Pure
        static Segment2afp.UncertainIntersection findsUncertainIntersectionSegmentSegmentWithoutEnds​(double x1,
                                                                                                     double y1,
                                                                                                     double x2,
                                                                                                     double y2,
                                                                                                     double x3,
                                                                                                     double y3,
                                                                                                     double x4,
                                                                                                     double y4)
        Do an intersection test of two segments for ensuring that the answer of "no intersect" is safe. If the function replies true, it may This function does not consider that the ends of the segments are intersecting.
        Parameters:
        x1 - is the first point of the first segment.
        y1 - is the first point of the first segment.
        x2 - is the second point of the first segment.
        y2 - is the second point of the first segment.
        x3 - is the first point of the second segment.
        y3 - is the first point of the second segment.
        x4 - is the second point of the second segment.
        y4 - is the second point of the second segment.
        Returns:
        the type of intersection.
        See Also:
        intersectsSegmentSegmentWithoutEnds(double, double, double, double, double, double, double, double)
      • interpolates

        static void interpolates​(double p1x,
                                 double p1y,
                                 double p2x,
                                 double p2y,
                                 double factor,
                                 Point2D<?,​?> result)
        Compute the interpolate point between the two points.
        Parameters:
        p1x - x coordinate of the first point.
        p1y - y coordinate of the first point.
        p2x - x coordinate of the second point.
        p2y - y coordinate of the second point.
        factor - is between 0 and 1; 0 for p1, and 1 for p2.
        result - the interpolate point.
      • intersectsLineLine

        @Pure
        static boolean intersectsLineLine​(double x1,
                                          double y1,
                                          double x2,
                                          double y2,
                                          double x3,
                                          double y3,
                                          double x4,
                                          double y4)
        Replies if two lines are intersecting.
        Parameters:
        x1 - is the first point of the first line.
        y1 - is the first point of the first line.
        x2 - is the second point of the first line.
        y2 - is the second point of the first line.
        x3 - is the first point of the second line.
        y3 - is the first point of the second line.
        x4 - is the second point of the second line.
        y4 - is the second point of the second line.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsSegmentLine

        @Pure
        static boolean intersectsSegmentLine​(double x1,
                                             double y1,
                                             double x2,
                                             double y2,
                                             double x3,
                                             double y3,
                                             double x4,
                                             double y4)
        Replies if a segment and a line are intersecting.
        Parameters:
        x1 - is the first point of the first segment.
        y1 - is the first point of the first segment.
        x2 - is the second point of the first segment.
        y2 - is the second point of the first segment.
        x3 - is the first point of the second line.
        y3 - is the first point of the second line.
        x4 - is the second point of the second line.
        y4 - is the second point of the second line.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsSegmentSegmentWithEnds

        @Pure
        static boolean intersectsSegmentSegmentWithEnds​(double x1,
                                                        double y1,
                                                        double x2,
                                                        double y2,
                                                        double x3,
                                                        double y3,
                                                        double x4,
                                                        double y4)
        Replies if two segments are intersecting. This function considers that the ends of the segments are intersecting. To ignore the ends of the segments, see intersectsSegmentSegmentWithoutEnds(double, double, double, double, double, double, double, double).
        Parameters:
        x1 - is the first point of the first segment.
        y1 - is the first point of the first segment.
        x2 - is the second point of the first segment.
        y2 - is the second point of the first segment.
        x3 - is the first point of the second segment.
        y3 - is the first point of the second segment.
        x4 - is the second point of the second segment.
        y4 - is the second point of the second segment.
        Returns:
        true if the two shapes are intersecting; otherwise false
        See Also:
        intersectsSegmentSegmentWithoutEnds(double, double, double, double, double, double, double, double)
      • intersectsSegmentSegmentWithoutEnds

        @Pure
        static boolean intersectsSegmentSegmentWithoutEnds​(double x1,
                                                           double y1,
                                                           double x2,
                                                           double y2,
                                                           double x3,
                                                           double y3,
                                                           double x4,
                                                           double y4)
        Replies if two segments are intersecting. This function considers that the ends of the segments are not intersecting. To include the ends of the segments in the intersection ranges, see intersectsSegmentSegmentWithEnds(double, double, double, double, double, double, double, double).
        Parameters:
        x1 - is the first point of the first segment.
        y1 - is the first point of the first segment.
        x2 - is the second point of the first segment.
        y2 - is the second point of the first segment.
        x3 - is the first point of the second segment.
        y3 - is the first point of the second segment.
        x4 - is the second point of the second segment.
        y4 - is the second point of the second segment.
        Returns:
        true if the two shapes are intersecting; otherwise false
        See Also:
        intersectsSegmentSegmentWithEnds(double, double, double, double, double, double, double, double)
      • isCollinearLines

        @Pure
        static boolean isCollinearLines​(double x1,
                                        double y1,
                                        double x2,
                                        double y2,
                                        double x3,
                                        double y3,
                                        double x4,
                                        double y4)
        Replies if two lines are colinear.

        The given two lines are described respectivaly by two points, i.e. (x1, y1) and (x2, y2) for the first line, and (x3, y3) and (x4, y4) for the second line.

        If you are interested to test if the two lines are parallel, see isParallelLines(double, double, double, double, double, double, double, double).

        Parameters:
        x1 - is the X coordinate of the first point of the first line.
        y1 - is the Y coordinate of the first point of the first line.
        x2 - is the X coordinate of the second point of the first line.
        y2 - is the Y coordinate of the second point of the first line.
        x3 - is the X coordinate of the first point of the second line.
        y3 - is the Y coordinate of the first point of the second line.
        x4 - is the X coordinate of the second point of the second line.
        y4 - is the Y coordinate of the second point of the second line.
        Returns:
        true if the two given lines are collinear.
        See Also:
        isParallelLines(double, double, double, double, double, double, double, double), Point2D.isCollinearPoints(double, double, double, double, double, double)
      • isParallelLines

        @Pure
        static boolean isParallelLines​(double x1,
                                       double y1,
                                       double x2,
                                       double y2,
                                       double x3,
                                       double y3,
                                       double x4,
                                       double y4)
        Replies if two lines are parallel.

        The given two lines are described respectivaly by two points, i.e. (x1, y1) and (x2, y2) for the first line, and (x3, y3) and (x4, y4) for the second line.

        If you are interested to test if the two lines are colinear, see isCollinearLines(double, double, double, double, double, double, double, double).

        Parameters:
        x1 - is the X coordinate of the first point of the first line.
        y1 - is the Y coordinate of the first point of the first line.
        x2 - is the X coordinate of the second point of the first line.
        y2 - is the Y coordinate of the second point of the first line.
        x3 - is the X coordinate of the first point of the second line.
        y3 - is the Y coordinate of the first point of the second line.
        x4 - is the X coordinate of the second point of the second line.
        y4 - is the Y coordinate of the second point of the second line.
        Returns:
        true if the two given lines are parallel.
        See Also:
        isCollinearLines(double, double, double, double, double, double, double, double)
      • isPointClosedToLine

        @Pure
        static boolean isPointClosedToLine​(double x1,
                                           double y1,
                                           double x2,
                                           double y2,
                                           double x,
                                           double y,
                                           double hitDistance)
        Replies if a point is closed to a line.
        Parameters:
        x1 - horizontal location of the first-line begining.
        y1 - vertical location of the first-line ending.
        x2 - horizontal location of the second-line begining.
        y2 - vertical location of the second-line ending.
        x - horizontal location of the point.
        y - vertical location of the point.
        hitDistance - is the maximal hitting distance.
        Returns:
        true if the point and the line have closed locations.
      • isPointClosedToSegment

        @Pure
        static boolean isPointClosedToSegment​(double x1,
                                              double y1,
                                              double x2,
                                              double y2,
                                              double x,
                                              double y,
                                              double hitDistance)
        Replies if a point is closed to a segment.
        Parameters:
        x1 - horizontal location of the first-segment begining.
        y1 - vertical location of the first-segment ending.
        x2 - horizontal location of the second-segment begining.
        y2 - vertical location of the second-segment ending.
        x - horizontal location of the point.
        y - vertical location of the point.
        hitDistance - is the maximal hitting distance.
        Returns:
        true if the point and the line have closed locations.
      • clipToRectangle

        @Pure
        default boolean clipToRectangle​(double rxmin,
                                        double rymin,
                                        double rxmax,
                                        double rymax)
        Clip the segment against the clipping rectangle according to the Cohen-Sutherland algorithm.
        Parameters:
        rxmin - is the min of the coordinates of the rectangle.
        rymin - is the min of the coordinates of the rectangle.
        rxmax - is the max of the coordinates of the rectangle.
        rymax - is the max of the coordinates of the rectangle.
        Returns:
        true if the segment has an intersection with the rectangle and the segment was clipped; false if the segment does not intersect the rectangle.
      • contains

        @Pure
        default boolean contains​(Shape2D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape2D
        Replies if this shape is inside the given shape.

        You must use the containing functions with a specific parameter type in place of this general function. Indeed, the implementation of this function is unefficient due to the tests against the types of the given shape, and the cast operators.

        Specified by:
        contains in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Specified by:
        contains in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        shape - the shape to compare to.
        Returns:
        true if the given shape is inside this shape; false otherwise.
      • equalsToShape

        @Pure
        default boolean equalsToShape​(IT shape)
        Description copied from interface: Shape2D
        Replies this shape is equal to the given shape.
        Specified by:
        equalsToShape in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        shape - the shape to compare to.
        Returns:
        true if this shape is equal is equal to the given path.
      • getClosestPointTo

        @Pure
        default P getClosestPointTo​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given circle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        circle - the circle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given ellipse.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        ellipse - the ellipse.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectngle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given oriented rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        orientedRectngle - the oriented rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given parallelogram.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        parallelogram - the parallelogram.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Path2afp<?,​?,​?,​?,​?,​?> path)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given path.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        path - the path.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        default P getClosestPointTo​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        rectangle - the rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given round rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        roundRectangle - the round rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        default P getClosestPointTo​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given segment.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        segment - the segment.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        default P getClosestPointTo​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
        Description copied from interface: Shape2afp
        Replies the closest point on this shape to the given triangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        triangle - the triangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getDistanceL1

        @Pure
        default double getDistanceL1​(Point2D<?,​?> pt)
        Description copied from interface: Shape2D
        Computes the L-1 (Manhattan) distance between this shape and point p1. The L-1 distance is equal to abs(x1-x2) + abs(y1-y2).
        Specified by:
        getDistanceL1 in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        pt - the point
        Returns:
        the distance.
      • getDistanceLinf

        @Pure
        default double getDistanceLinf​(Point2D<?,​?> pt)
        Description copied from interface: Shape2D
        Computes the L-infinite distance between this shape and point p1. The L-infinite distance is equal to MAX[abs(x1-x2), abs(y1-y2)].
        Specified by:
        getDistanceLinf in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        pt - the point
        Returns:
        the distance.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Point2D<?,​?> pt)
        Description copied from interface: Shape2D
        Replies the squared value of the minimal distance from this shape to the given point.
        Specified by:
        getDistanceSquared in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        pt - the point.
        Returns:
        squared value of the minimal distance between this shape and the point.
      • getLength

        @Pure
        default double getLength()
        Replies the length of the segment.
        Returns:
        the length.
      • getLengthSquared

        @Pure
        default double getLengthSquared()
        Replies the squared length of the segment.
        Returns:
        the squared length.
      • getP1

        @Pure
        default P getP1()
        Replies the first point.
        Returns:
        the first point.
      • getP2

        @Pure
        default P getP2()
        Replies the second point.
        Returns:
        the second point.
      • getX1

        @Pure
        double getX1()
        Replies the X of the first point.
        Returns:
        the x of the first point.
      • getX2

        @Pure
        double getX2()
        Replies the X of the second point.
        Returns:
        the x of the second point.
      • getY1

        @Pure
        double getY1()
        Replies the Y of the first point.
        Returns:
        the y of the first point.
      • getY2

        @Pure
        double getY2()
        Replies the Y of the second point.
        Returns:
        the y of the second point.
      • intersects

        @Pure
        default boolean intersects​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given circle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        circle - the circle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given ellipse.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        ellipse - the ellipse.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(MultiShape2afp<?,​?,​?,​?,​?,​?,​?> multishape)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given multishape.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        multishape - the multishape.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given rectangle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        orientedRectangle - the oriented rectangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given parallelogram.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        parallelogram - the parallelogram.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(PathIterator2afp<?> iterator)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the shape representing the given path iterator.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        iterator - the path iterator.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given rectangle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        rectangle - the rectangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given rectangle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        roundRectangle - the round rectangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given line.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        segment - the segment.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
        Description copied from interface: Shape2afp
        Replies if this shape is intersecting the given triangle.
        Specified by:
        intersects in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        triangle - the triangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • isEmpty

        default boolean isEmpty()
        Description copied from interface: Shape2D
        Replies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.
        Specified by:
        isEmpty in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Segment2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Returns:
        true if the shape is empty; false otherwise.
      • set

        void set​(double x1,
                 double y1,
                 double x2,
                 double y2)
        Change the line.
        Parameters:
        x1 - x coordinate of the first point.
        y1 - y coordinate of the first point.
        x2 - x coordinate of the second point.
        y2 - y coordinate of the second point.
      • set

        default void set​(Point2D<?,​?> firstPoint,
                         Point2D<?,​?> secondPoint)
        Change the line.
        Parameters:
        firstPoint - the first point.
        secondPoint - the second point.
      • setP1

        default void setP1​(double x,
                           double y)
        Change the first point.
        Parameters:
        x - x coordinate of the first point.
        y - y coordinate of the first point.
      • setP1

        default void setP1​(Point2D<?,​?> pt)
        Change the first point.
        Parameters:
        pt - the first point.
      • setP2

        default void setP2​(double x,
                           double y)
        Change the second point.
        Parameters:
        x - x coordinate of the second point.
        y - y coordinate of the second point.
      • setP2

        default void setP2​(Point2D<?,​?> pt)
        Change the second point.
        Parameters:
        pt - the second point.
      • setX1

        void setX1​(double x)
        Sets a new value in the X of the first point.
        Parameters:
        x - the new value double x
      • setX2

        void setX2​(double x)
        Sets a new value in the X of the second point.
        Parameters:
        x - the new value double x
      • setY1

        void setY1​(double y)
        Sets a new value in the Y of the first point.
        Parameters:
        y - the new value double y
      • setY2

        void setY2​(double y)
        Sets a new value in the Y of the second point.
        Parameters:
        y - the new value double y