public Coordinate[] GetOffsetCurve(Coordinate[] inputPts, double distance)
        {
            _distance = distance;

            // a zero width offset curve is empty
            if (distance == 0.0)
            {
                return(null);
            }

            var    isRightSide            = distance < 0.0;
            double posDistance            = Math.Abs(distance);
            OffsetSegmentGenerator segGen = GetSegmentGenerator(posDistance);

            if (inputPts.Length <= 1)
            {
                ComputePointCurve(inputPts[0], segGen);
            }
            else
            {
                ComputeOffsetCurve(inputPts, isRightSide, segGen);
            }
            Coordinate[] curvePts = segGen.GetCoordinates();
            // for right side line is traversed in reverse direction, so have to reverse generated line
            if (isRightSide)
            {
                CoordinateArrays.Reverse(curvePts);
            }
            return(curvePts);
        }
        /// <summary>
        /// This method handles the degenerate cases of single points and lines,
        /// as well as rings.
        /// </summary>
        /// <returns>A Coordinate array representing the curve<br/>
        /// or <c>null</c> if the curve is empty</returns>
        public Coordinate[] GetRingCurve(Coordinate[] inputPts, Positions side, double distance)
        {
            _distance = distance;
            if (inputPts.Length <= 2)
            {
                return(GetLineCurve(inputPts, distance));
            }

            // optimize creating ring for for zero distance
            if (distance == 0.0)
            {
                return(CopyCoordinates(inputPts));
            }
            OffsetSegmentGenerator segGen = GetSegmentGenerator(distance);

            ComputeRingBufferCurve(inputPts, side, segGen);
            return(segGen.GetCoordinates());
        }