HelixToolkit.Wpf.MeshBuilder.GetCircle C# (CSharp) Method

GetCircle() public static method

Gets a circle section (cached).
public static GetCircle ( int thetaDiv ) : IList
thetaDiv int /// The number of division. ///
return IList
        public static IList<Point> GetCircle(int thetaDiv)
        {
            IList<Point> circle;
            if (!CircleCache.TryGetValue(thetaDiv, out circle))
            {
                circle = new PointCollection();
                CircleCache.Add(thetaDiv, circle);
                for (int i = 0; i < thetaDiv; i++)
                {
                    double theta = Math.PI * 2 * ((double)i / (thetaDiv - 1));
                    circle.Add(new Point(Math.Cos(theta), -Math.Sin(theta)));
                }
            }

            return circle;
        }