Esempio n. 1
0
  public Object power(Number d, Complex c) {
    Complex base = new Complex(d.doubleValue(), 0.0);
    Complex temp = base.power(c);

    if (temp.im() == 0) return new Double(temp.re());
    else return temp;
  }
Esempio n. 2
0
 public Complex sub(Number d, Complex c) {
   return new Complex(d.doubleValue() - c.re(), -c.im());
 }
Esempio n. 3
0
 public Complex sub(Complex c, Number d) {
   return new Complex(c.re() - d.doubleValue(), c.im());
 }
Esempio n. 4
0
 public Complex sub(Complex c1, Complex c2) {
   return new Complex(c1.re() - c2.re(), c1.im() - c2.im());
 }
Esempio n. 5
0
  public Object power(Complex c, Number d) {
    Complex temp = c.power(d.doubleValue());

    if (temp.im() == 0) return new Double(temp.re());
    else return temp;
  }
Esempio n. 6
0
  public Object power(Complex c1, Complex c2) {
    Complex temp = c1.power(c2);

    if (temp.im() == 0) return new Double(temp.re());
    else return temp;
  }