Example #1
0
        public Form1()
        {
            InitializeComponent();

            // create c1 by using the default constructor
            c1          = new bugCircle(); // unit cirlce
            c1.Radius   = 10.0;
            c1.center.X = 5;
            c1.center.Y = 10;
            c1.name     = " a cute circle ";



            // create c2 and c3 by using the overloaded constructor
            c2 = new bugCircle(-5.0, new Point(3, 3)); // another unit circle
            c3 = new bugCircle(3.0, new Point(5, 4));  // yet another one

            p1 = new bugPoint();                       // locate at the origin
            p2 = new bugPoint(3F, 4F);
            p3 = new bugPoint(2F, 4F);

            bugPoint p4; // = p2.Add(p3);

            p4 = p2 + p3;

            this.Text  = p4.ToString();
            this.Text += "dist " + p1.Distance2(p2).ToString();
            this.Text += "ang = " + p2.SlopeWChoice(bugPoint.AngleType.Degree).ToString();
        }
Example #2
0
        public Form1()
        {
            InitializeComponent();

            // create c1 by using the default constructor
            c1          = new bugCircle(); // unit cirlce
            c1.Radius   = 10.0;
            c1.center.X = 5;
            c1.center.Y = 10;
            c1.name     = " a cute circle ";

            drawingpen = new Pen(Color.YellowGreen);

            // create c2 and c3 by using the overloaded constructor
            c2 = new bugCircle(-5.0, new Point(3, 3)); // another unit circle
            c3 = new bugCircle(3.0, new Point(5, 4));  // yet another one

            /*
             * p1 = new bugPoint(); // locate at the origin
             * p2 = new bugPoint(3F, 4F);
             * p3 = new bugPoint(2F, 4F);
             *
             * Debug.WriteLine("there are " + bugPoint.nPoints.ToString() + " many points");
             *
             *
             * bugPoint p4; // = p2.Add(p3);
             * p4 = p2 + p3;
             *
             * Debug.WriteLine("there are " + bugPoint.nPoints.ToString() + " many points");
             *
             * this.Text = p4.ToString();
             * this.Text += "dist " + p1.Distance2(p2).ToString();
             * this.Text += "ang = " + p2.SlopeWChoice(bugPoint.AngleType.Degree).ToString();
             * //*/
        }