Ejemplo n.º 1
0
Archivo: GCHForm.cs Proyecto: onest/C5
        private void runButton_Click(object sender, System.EventArgs e)
        {
            int N = int.Parse(pointCount.Text);

            pts = new Point[N];
            for (int i = 0; i < N; i++)
            {
                pts[i] = Point.Random(500, 500);
            }
            chpts = Convexhull.ConvexHull(pts);

            drawarea.Invalidate();
        }
Ejemplo n.º 2
0
 static void Main(String[] args)
 {
     if (args.Length == 1)
     {
         string  arg = args[0];
         int     N   = int.Parse(arg);
         Point[] pts = new Point[N];
         for (int i = 0; i < N; i++)
         {
             pts[i] = Point.Random(500, 500);
         }
         Point[] chpts = Convexhull.ConvexHull(pts);
         Console.WriteLine("Area is " + Area(chpts));
         Print(chpts);
     }
     else
     {
         Console.WriteLine("Usage: GConvexHull <pointcount>\n");
     }
 }