1 package de.lathanda.eos.base.math;
39 private final double a;
43 private final double b;
82 return new Complex(a + c.a, b + c.b);
92 return new Complex(a - c.a, b - c.b);
120 return new Complex(a * x, b * x);
130 return new Complex(a * c.a - b * c.b, a * c.b + b * c.a);
140 return new Complex(a / x, b / x);
160 double r = Math.
pow(
abs(), x);
161 double phi = x *
angle();
162 return new Complex(Math.cos(phi) * r, Math.sin(phi) * r);
203 double r = Math.
pow(Math.E, -
angle());
204 double phi = Math.
log(
abs());
205 return new Complex(Math.cos(phi) * r, Math.sin(phi) * r);
245 return Math.sqrt(a * a + b * b);
261 throw new ArithmeticException(
"Complex.angle(" +
this +
")");
264 return (b < 0) ? Math.atan(a / b) : Math.atan(a / b) + Math.PI;
284 return a +
"+" + b +
"i";
294 return a == c.a && b == c.b;
Complex multiply(double x)
Complex substract(Complex c)
Complex multiply(Complex c)
boolean equals(Complex c)
static final Complex ZERO
0
Complex log(Complex base)
static final Complex ONE
1
Complex(double a, double b)
Complex divide(Complex c)