public static ComplexClass Compliment(ComplexClass a)
 {
     double x, y;
     x = a.x;
     y = -a.y;
     return new ComplexClass(x, y);
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("ComplexNo Class and Struct");

            ComplexClass a = new ComplexClass(1,2);
            Console.WriteLine("a= {0}", a);
            ComplexClass b = new ComplexClass(3, 4);
            Console.WriteLine("b = {0}", b);
            Console.WriteLine("a+b = {0}", a+b);

            double w= ComplexClass.ArgumentDegrees(a);
            Console.WriteLine(w);
            Console.ReadLine();
        }
 public static double Magnitude(ComplexClass a)
 {
     return Math.Sqrt(a.x * a.x + a.y * a.y);
 }
 public static double ArgumentRadians(ComplexClass a)
 {
     return Math.Atan(a.y / a.x);
 }
 public static double ArgumentDegrees(ComplexClass a)
 {
     return (Math.Atan(a.y/a.x))* (180 / Math.PI);
 }
 public ComplexClass(ComplexClass a)
 {
     x = a.x;
     y = a.y;
 }