Beispiel #1
0
        public static TTriangle operator +(TTriangle triangle, TTriangle randTriangle)
        {
            return(new TTriangle(triangle.a + randTriangle.b, triangle.c + randTriangle.a,
                                 triangle.b + randTriangle.c));

            TTriangle n1 = new TTriangle(triangle);
            TTriangle n2 = new TTriangle(randTriangle);
        }
Beispiel #2
0
        public static TTriangle operator -(TTriangle triangle, TTriangle randTriangle)
        {
            return(new TTriangle(triangle.a - randTriangle.b, triangle.c - randTriangle.a,
                                 triangle.b - randTriangle.c));

            TTriangle m1 = new TTriangle(triangle);
            TTriangle m2 = new TTriangle(randTriangle);
        }
Beispiel #3
0
        private void button7_Click(object sender, EventArgs e)
        {
            TTriangle t1 = new TTriangle(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text), Convert.ToDouble(textBox3.Text));
            double    t2 = Convert.ToDouble(textBox9.Text);
            TTriangle s  = t1 * t2;

            textBox10.Text = s.seedsTriangle().ToString();
        }
Beispiel #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            Random    rnd = new Random();
            TTriangle t1  = new TTriangle(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text), Convert.ToDouble(textBox3.Text));
            TTriangle t2  = new TTriangle(Convert.ToDouble(rnd.Next(1, 10)), Convert.ToDouble(rnd.Next(1, 10)), Convert.ToDouble(rnd.Next(1, 10)));

            textBox6.Text = t2.comparisonTriangle(t1).ToString();
        }
Beispiel #5
0
        private void button6_Click(object sender, EventArgs e)
        {
            Random    rnd = new Random();
            TTriangle t1  = new TTriangle(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text), Convert.ToDouble(textBox3.Text));
            TTriangle t2  = new TTriangle(Convert.ToDouble(rnd.Next(1, 10)), Convert.ToDouble(rnd.Next(1, 10)), Convert.ToDouble(rnd.Next(1, 10)));
            TTriangle s   = t1 - t2;

            textBox8.Text = s.seedsTriangle().ToString();
        }
Beispiel #6
0
 public string comparisonTriangle(TTriangle otherTriangle)
 {
     if (perimeterTriangle() == otherTriangle.perimeterTriangle())
     {
         return("Трикутники рівні");
     }
     else
     {
         return("Трикутники не рівні");
     }
 }
Beispiel #7
0
 public TTriangle(TTriangle text)
 {
     this.a = text.a;
     this.b = text.b;
     this.c = text.c;
 }
Beispiel #8
0
        private void button3_Click(object sender, EventArgs e)
        {
            TTriangle trg = new TTriangle(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text), Convert.ToDouble(textBox3.Text));

            textBox5.Text = trg.areaTriangle().ToString();
        }
Beispiel #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            TTriangle trg = new TTriangle(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text), Convert.ToDouble(textBox3.Text));

            listBox1.Items.Add(trg.seedsTriangle());
        }