System.Drawing.PieChart.PieSlice.GetEllipseRadius C# (CSharp) Method

GetEllipseRadius() private method

Evaluates the distance of an ellipse perimeter point for a given angle.
private GetEllipseRadius ( double angle ) : double
angle double /// Angle for which distance has to be evaluated. ///
return double
        private double GetEllipseRadius(double angle)
        {
            double a = m_boundingRectangle.Width / 2;
            double b = m_boundingRectangle.Height / 2;
            double a2 = a * a;
            double b2 = b * b;
            double cosFi = Math.Cos(angle);
            double sinFi = Math.Sin(angle);
            // distance of the ellipse perimeter point
            return (a * b) / Math.Sqrt(b2 * cosFi * cosFi + a2 * sinFi * sinFi);
        }