(complex)
| 2005 | return this |
| 2006 | } |
| 2007 | plus(complex) { |
| 2008 | if (!complex.isComplex) { |
| 2009 | throw "[TheoremJS]: Complex operation require complex numbers" |
| 2010 | } |
| 2011 | this.a = this.a.plus(complex.a) |
| 2012 | this.b = this.b.plus(complex.b) |
| 2013 | return this |
| 2014 | } |
| 2015 | pow(complex) { |
| 2016 | /* I couldn't find a good formula, so here is a derivation and optimization |
| 2017 | * |