Пример #1
0
        static void Main(string[] args)
        {
            //complex no.

            ComplexNo a = new ComplexNo(2, 6);
            ComplexNo b = new ComplexNo(4, 1);

            Console.WriteLine(a.Scaleby(.5));
            Console.WriteLine(a.Division(b));

            Console.ReadLine();
        }
Пример #2
0
 public ComplexNo Subtraction(ComplexNo b)
 {
     return new ComplexNo(this.x - b.x, this.y - b.y);
 }
Пример #3
0
 public ComplexNo Multiplication(ComplexNo b)
 {
     return new ComplexNo(((this.x*b.x) - ( this.y*b.y)),((this.x * b.y) + (b.x*this.y)));
 }
Пример #4
0
 public ComplexNo Division(ComplexNo b)
 {
     return new ComplexNo ((this.Multiplication(b.Conjugate())).Scaleby(1/(b.x*b.x + b.y*b.y)));
 }
Пример #5
0
 //methods
 public ComplexNo Addition(ComplexNo b)
 {
     return new ComplexNo(this.x + b.x, this.x + b.y);
 }
Пример #6
0
 public ComplexNo(ComplexNo a)
 {
     this.x = a.x; this.y = a.y;
 }