C# 获取一系列不连续值的算法

C# 获取一系列不连续值的算法,c#,algorithm,C#,Algorithm,我试图通过以下方式绘制一个“断开”的椭圆: PointF p; List<IntPoint> list; int res = 1000; for(int i = 0; i < res; ++i) { if(i <= 250) // do nothing else { p.X = h + a * Math.Cos(i/res * Math.PI * 2); p.Y = k + b * Math.Sin(i/res *

我试图通过以下方式绘制一个“断开”的椭圆:

PointF p; 
List<IntPoint> list;
int res = 1000;
for(int i = 0; i < res; ++i)
{
    if(i <= 250) // do nothing
    else
    {
        p.X = h + a * Math.Cos(i/res * Math.PI * 2);
        p.Y = k + b * Math.Sin(i/res * Math.PI * 2);
        list.Add(p);
    }  
}
pointfp;
名单;
int res=1000;
对于(int i=0;i如果(iAngles wrap.那么你可以把(100360)+(0,70)当作(100360)+(360430),也就是说,它就是(100430)

int startAngle=100;
内端角=430;
p点;
名单;
int res=1000;
对于(int i=startAngle*res/360;i
    int startAngle = 100;
    int endAngle = 430;
    PointF p; 
    List<IntPoint> list;
    int res = 1000;
    for(int i = startAngle*res/360; i <= endAngle*res/360; ++i)
    {
        p.X = h + a * Math.Cos(i/res * Math.PI * 2);
        p.Y = k + b * Math.Sin(i/res * Math.PI * 2);
        list.Add(p);
    }