Gu.Wpf.Geometry.Ellipse.RadiusInDirection C# (CSharp) Method

RadiusInDirection() private method

private RadiusInDirection ( System.Windows.Vector directionFromCenter ) : double
directionFromCenter System.Windows.Vector
return double
        internal double RadiusInDirection(Vector directionFromCenter)
        {
            var angle = Math.Atan2(directionFromCenter.Y, directionFromCenter.X);
            var cos = Math.Cos(angle);
            var sin = Math.Sin(angle);
            var a = this.RadiusX;
            var b = this.RadiusY;
            var r2 = 1 / (cos * cos / (a * a) + sin * sin / (b * b));
            return Math.Sqrt(r2);
        }