PixelFarm.Agg.VertexSource.Arc.Normalize C# (CSharp) Method

Normalize() private method

private Normalize ( double angle1, double angle2, ArcDirection direction ) : void
angle1 double
angle2 double
direction ArcDirection
return void
        void Normalize(double angle1, double angle2, ArcDirection direction)
        {
            double ra = (Math.Abs(radiusX) + Math.Abs(radiusY)) / 2;
            flatenDeltaAngle = Math.Acos(ra / (ra + 0.125 / m_Scale)) * 2;
            if (direction == ArcDirection.CounterClockWise)
            {
                while (angle2 < angle1)
                {
                    angle2 += Math.PI * 2.0;
                }
            }
            else
            {
                while (angle1 < angle2)
                {
                    angle1 += Math.PI * 2.0;
                }
                flatenDeltaAngle = -flatenDeltaAngle;
            }
            m_Direction = direction;
            startAngle = angle1;
            endAngle = angle2;
            m_IsInitialized = true;
            calculateNSteps = (int)Math.Floor(((endAngle - startAngle) / flatenDeltaAngle));
        }
    }