using System.Text;
namespace compalx_no
{
class complex
{
double a, b, c, d;
public complex(double v, double x)
{
a = v;
b = x;
}
public complex mul(complex t, complex r)
{
c = t.a * r.a - t.b * r.b;
d = t.a * r.b + t.b * r.a;
t.a = c;
t.b = d;
return t;
}
public complex()
{
}
public void display()
{
Console.WriteLine("The result of the complex number" + a + "i" + b);
}
}
class Program
{
static void Main(string[] args)
{
complex s = new complex(2, 3);
complex w = new complex(4, 1);
complex p = new complex();
p = s.mul(s, w);
p.display();
}
}
}
namespace compalx_no
{
class complex
{
double a, b, c, d;
public complex(double v, double x)
{
a = v;
b = x;
}
public complex mul(complex t, complex r)
{
c = t.a * r.a - t.b * r.b;
d = t.a * r.b + t.b * r.a;
t.a = c;
t.b = d;
return t;
}
public complex()
{
}
public void display()
{
Console.WriteLine("The result of the complex number" + a + "i" + b);
}
}
class Program
{
static void Main(string[] args)
{
complex s = new complex(2, 3);
complex w = new complex(4, 1);
complex p = new complex();
p = s.mul(s, w);
p.display();
}
}
}
No comments:
Post a Comment