private float GetRadius(CenterPivot centerPivot)
 {
     var width = centerPivot.Center.ToUtm().X - centerPivot.EndPoint.ToUtm().X;
     
     return (float)Math.Abs(width);
 }
        private static CenterPivot LoadCenterPivotPattern(XmlNode lineNode)
        {
            var pattern = new CenterPivot { GuidancePatternType = GuidancePatternTypeEnum.CenterPivot };

            var pointNodes = lineNode.SelectNodes("PNT");
            if (pointNodes.Count < 1 || pointNodes.Count > 3)
                return null;

            pattern.Center = ShapeLoader.LoadPoint(pointNodes[0]);
            if (pattern.Center == null)
                return null;

            pattern.StartPoint = pointNodes.Count > 1 ? ShapeLoader.LoadPoint(pointNodes[1]) : null;
            pattern.EndPoint = pointNodes.Count > 2 ? ShapeLoader.LoadPoint(pointNodes[2]) : null;

            return pattern;
        }
 private void ProcessCenterPivot(CenterPivot centerPivot)
 {
     var delta = _drawingUtil.GetDelta();
     var center = centerPivot.Center.ToUtm().ToXy(_drawingUtil.MinX, _drawingUtil.MinY, delta);
     var radius = GetRadius(centerPivot);
     _drawingUtil.Graphics.DrawEllipse(DrawingUtil.Pen, center.X - radius, center.Y - radius, radius + radius, radius + radius);
 }
        private static void WritePivot(XmlWriter writer, CenterPivot centerPivot)
        {
            var line = new LineString { Points = new List<Point>() };
            line.Points.Add(centerPivot.Center);

            if (centerPivot.StartPoint != null)
            {
                line.Points.Add(centerPivot.StartPoint);
                if (centerPivot.EndPoint != null)
                    line.Points.Add(centerPivot.EndPoint);
            }

            ShapeWriter.WriteLine(writer, line, "5");
        }