Class EllipticArcSegment


  • public class EllipticArcSegment
    extends Segment
    An elliptic arc segment for use in a multipart geometry.

    An elliptic arc is the portion of the boundary of a 2D ellipse that connects two points.

    Since:
    100.12.0
    • Constructor Summary

      Constructors 
      Constructor Description
      EllipticArcSegment​(Point centerPoint, double rotationAngle, double semiMajorAxis, double minorMajorRatio, double startAngle, double centralAngle, SpatialReference spatialReference)
      Creates an elliptic arc based on parameters that define an ellipse and the portion of that ellipse that defines the arc.
      EllipticArcSegment​(Point startPoint, Point endPoint, double rotationAngle, boolean isMinor, boolean isCounterClockwise, double semiMajorAxis, double minorMajorRatio, SpatialReference spatialReference)
      Creates an elliptic arc segment from the given start and end points, and other parameters that define an ellipse.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static EllipticArcSegment createCircularEllipticArc​(Point centerPoint, double radius, double startAngle, double centralAngle, SpatialReference spatialReference)
      Creates an EllipticArcSegment that is a partial circle shape from the center point and radius of the embedded circle, and the start and central angle around that circle.
      static EllipticArcSegment createCircularEllipticArc​(Point startPoint, Point endPoint, Point interiorPoint, SpatialReference spatialReference)
      Creates an EllipticArcSegment from start, end, and interior points that is a partial circle shape.
      Point getCenterPoint()
      Gets the center point of the ellipse that this segment is defined upon.
      double getCentralAngle()
      Gets the parametric angle in radians measuring the span of the arc from start angle to end angle.
      double getEndAngle()
      Gets the parametric angle in radians of the end of the arc relative to the major axis of the embedded ellipse.
      double getMinorMajorRatio()
      Gets the ratio of the length of the semi-minor axis to the semi-major axis.
      double getRotationAngle()
      Gets the angle in radians by which the major axis of the ellipse this segment is based upon is rotated from the x-axis.
      double getSemiMajorAxis()
      Gets the length of the longer of the two axes of the ellipse upon which this arc is based.
      double getSemiMinorAxis()
      Gets the length of the shorter of the two axes of the ellipse upon which this arc is based.
      double getStartAngle()
      Gets the parametric angle in radians of the start of the arc relative to the major axis of the embedded ellipse.
      boolean isCircular()
      Indicates if this arc is a portion of the boundary of a 2D circle.
      boolean isCounterClockwise()
      Indicates if the direction of the segment, from start point to end point, proceeds in a counterclockwise direction.
      java.lang.String toString()
      Returns a string representation of this EllipticArcSegment instance.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • EllipticArcSegment

        public EllipticArcSegment​(Point centerPoint,
                                  double rotationAngle,
                                  double semiMajorAxis,
                                  double minorMajorRatio,
                                  double startAngle,
                                  double centralAngle,
                                  SpatialReference spatialReference)
        Creates an elliptic arc based on parameters that define an ellipse and the portion of that ellipse that defines the arc.

        The spatial reference parameter is used if the center point parameter has a null spatial reference. If both spatial references are supplied, they must be equal.

        The z and m values of the center point (if present) are ignored. Use EllipticArcSegment(Point, Point, double, boolean, boolean, double, double, SpatialReference) to create an EllipticArcSegment with end points with z and/or m values.

        Parameters:
        centerPoint - the center point of the embedded ellipse
        rotationAngle - the angle in radians by which the major axis of the embedded ellipse is rotated from the x-axis. A positive value corresponds to a counterclockwise rotation from the x-axis. The value is taken in form of the modulo of 2 * PI (360 degrees); for example, an input rotation angle of 7.5 radians (430 degrees) would return a segment with a rotation angle of 1.22 radians (70 degrees).
        semiMajorAxis - the length of the semi-major axis of the embedded ellipse in the units of the spatial reference
        minorMajorRatio - the ratio of the length of the semi-minor axis to the length of the semi-major axis of the embedded ellipse
        startAngle - the parametric angle in radians of the start of the arc relative to the major axis of the embedded ellipse. A positive value corresponds to a counterclockwise rotation from the major axis. The value is taken in form of the modulo of 2 * PI (360 degrees); for example, an input rotation angle of 7.5 radians (430 degrees) would return a segment with a rotation angle of 1.22 radians (70 degrees).
        centralAngle - the parametric angle in radians measuring the span of the arc from the start angle to the end angle. A positive value corresponds to a counterclockwise arc sweep. Values larger than 2 * PI (360 degrees) return a segment with a central angle of exactly 2 * PI (360 degrees), resulting in a full ellipse where the start and end points are identical.
        spatialReference - a spatial reference to use for the segment if the center point parameter does not have a spatial reference set, may be null
        Throws:
        java.lang.IllegalArgumentException - if centerPoint is null
        Since:
        100.12.0
      • EllipticArcSegment

        public EllipticArcSegment​(Point startPoint,
                                  Point endPoint,
                                  double rotationAngle,
                                  boolean isMinor,
                                  boolean isCounterClockwise,
                                  double semiMajorAxis,
                                  double minorMajorRatio,
                                  SpatialReference spatialReference)
        Creates an elliptic arc segment from the given start and end points, and other parameters that define an ellipse.

        The z and m values of the start and end points (if present) are used in the EllipticArcSegment.

        To maintain the given startPoint and endPoint in the new segment, the other parameters may be adjusted if required. Such adjustments are made according to the Scalable Vector Graphics 1.1 Specification, Appendix F.6.5. If these cannot be adjusted sufficiently, an arc represented with a straight line will be returned.

        Parameters:
        startPoint - the start point of the segment
        endPoint - the end point of the segment
        rotationAngle - the angle in radians by which the major axis of the embedded ellipse is rotated from the x-axis
        isMinor - true if the central angle of the segment is less than PI
        isCounterClockwise - true if the direction of the segment, from start point to end point, proceeds in a counterclockwise direction, otherwise false
        semiMajorAxis - the length of the semi-major axis of the embedded ellipse in the units of the spatial reference
        minorMajorRatio - the ratio of the length of the semi-minor axis to the length of the semi-major axis of the embedded ellipse
        spatialReference - a spatial reference to use for the segment if the points do not have spatial references set, may be null
        Throws:
        java.lang.IllegalArgumentException - if startPoint is null
        java.lang.IllegalArgumentException - if endPoint is null
        Since:
        100.12.0
    • Method Detail

      • getCenterPoint

        public Point getCenterPoint()
        Gets the center point of the ellipse that this segment is defined upon.
        Returns:
        the center point of the ellipse that this segment is defined upon
        Since:
        100.12.0
      • getCentralAngle

        public double getCentralAngle()
        Gets the parametric angle in radians measuring the span of the arc from start angle to end angle. A positive value corresponds to a counterclockwise arc sweep.

        This value is always between -2*PI and 2*PI, these limits indicating this arc forms a complete ellipse in either clockwise or counterclockwise direction.

        Returns:
        the central angle, in radians, relative to the x-axis of the ellipse upon which this segment is based
        Since:
        100.12.0
      • getEndAngle

        public double getEndAngle()
        Gets the parametric angle in radians of the end of the arc relative to the major axis of the embedded ellipse. A positive value corresponds to a counterclockwise rotation from the major axis.
        Returns:
        the angle, in radians, defining where this arc ends, measured from a horizontal line through the center point
        Since:
        100.12.0
      • isCounterClockwise

        public boolean isCounterClockwise()
        Indicates if the direction of the segment, from start point to end point, proceeds in a counterclockwise direction.
        Returns:
        indicates if the direction of the segment, from start point to end point, proceeds in a counterclockwise direction
        Since:
        100.12.0
      • getMinorMajorRatio

        public double getMinorMajorRatio()
        Gets the ratio of the length of the semi-minor axis to the semi-major axis.
        Returns:
        the ratio of the length of the semi-minor axis to the semi-major axis
        Since:
        100.12.0
      • getRotationAngle

        public double getRotationAngle()
        Gets the angle in radians by which the major axis of the ellipse this segment is based upon is rotated from the x-axis.
        Returns:
        the angle, in radians, at which the ellipse that this segment is based upon is rotated
        Since:
        100.12.0
      • getSemiMajorAxis

        public double getSemiMajorAxis()
        Gets the length of the longer of the two axes of the ellipse upon which this arc is based.

        The semi-major axis always lies on the line between 0 and PI radians.

        The length is in the units of the spatial reference.

        Returns:
        the length of the longer of the two axes of the ellipse upon which this arc is based
        Since:
        100.12.0
      • getSemiMinorAxis

        public double getSemiMinorAxis()
        Gets the length of the shorter of the two axes of the ellipse upon which this arc is based.

        The semi-minor axis always lies on the line between PI/2 and 3*PI/2 radians.

        The length is in the units of the spatial reference.

        Returns:
        the length of the shorter of the two axes of the ellipse upon which this arc is based
        Since:
        100.12.0
      • getStartAngle

        public double getStartAngle()
        Gets the parametric angle in radians of the start of the arc relative to the major axis of the embedded ellipse. A positive value corresponds to a counterclockwise rotation from the major axis.
        Returns:
        the angle, in radians, defining where this arc begins, measured from a horizontal line through the center point
        Since:
        100.12.0
      • createCircularEllipticArc

        public static EllipticArcSegment createCircularEllipticArc​(Point centerPoint,
                                                                   double radius,
                                                                   double startAngle,
                                                                   double centralAngle,
                                                                   SpatialReference spatialReference)
        Creates an EllipticArcSegment that is a partial circle shape from the center point and radius of the embedded circle, and the start and central angle around that circle.

        The z and m values of the center point (if present) are ignored. Use createCircularEllipticArc(Point, Point, Point, SpatialReference) to create a circular EllipticArcSegment with end points with z and/or m values.

        Parameters:
        centerPoint - the center point of the embedded circle
        radius - the distance from the center of the embedded circle to its perimeter
        startAngle - the parametric angle in radians of the start of the arc relative to the major axis of the embedded ellipse. A positive value corresponds to a counterclockwise rotation from the major axis.
        centralAngle - the parametric angle in radians measuring the span of the arc from start angle to end angle. A positive value corresponds to a counterclockwise arc sweep.
        spatialReference - the spatial reference of the new segment, may be null
        Returns:
        a new EllipticArcSegment with the given center point, radius, start and central angles, and spatial reference, where isCircular() is true
        Throws:
        java.lang.IllegalArgumentException - if centerPoint is null
        Since:
        100.12.0
      • createCircularEllipticArc

        public static EllipticArcSegment createCircularEllipticArc​(Point startPoint,
                                                                   Point endPoint,
                                                                   Point interiorPoint,
                                                                   SpatialReference spatialReference)
        Creates an EllipticArcSegment from start, end, and interior points that is a partial circle shape.

        The z and m values of the start and end points (if present) are used in the circular EllipticArcSegment. The z and m values of the interior point (if present) are ignored.

        Parameters:
        startPoint - the start point of the segment
        endPoint - the end point of the segment
        interiorPoint - a point along the circular arc, between the start and end points
        spatialReference - the spatial reference of the new segment, may be null
        Returns:
        a new EllipticArcSegment with the given start, through and end point, and spatial reference, where isCircular() is true
        Throws:
        java.lang.IllegalArgumentException - if startPoint is null
        java.lang.IllegalArgumentException - if endPoint is null
        java.lang.IllegalArgumentException - if interiorPoint is null
        Since:
        100.12.0
      • toString

        public java.lang.String toString()
        Returns a string representation of this EllipticArcSegment instance. The format and content of this string is subject to change without notice.

        This value may be useful for debugging purposes, but cannot be relied upon for persistence purposes.

        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of this segment with useful information for debugging.
        Since:
        100.12.0