## Thursday, 3 September 2009

### Imaginary Numbers

can't see em.

okay, so you might know that sqrt(-1) == i, but how?

wrong! the sqrt of any number can be one of two numbers! haha caught you already.

sqrt( -1 ) == i OR -i

oh. okay.

so, given that, what's the sqrt of i, or -i?

well the simplest way of looking at the problem is actually using the 2D plane of the complex number space...

at -1, the square (1) is 180 degrees away.
at i (or -i) the square (-1), is 90 degrees away.
the same can be said of the sqrt of i or -i. The number is no longer a simple Real, or Imaginary number, but a complex number consisting of the 45 degree components of a unit vector between i (or -i) and 1.

sqrt( i ) == cos(pi/4) + sin(pi/4) * i
sqrt( -i ) == cos(pi/4) + sin(pi/4) * -i or sqrt( i ) = cos(pi/4) - sin(pi/4) * i

i used cos and sin even though they give the same values because the technique is used for any other root of -1.

-1 ^ (1/rootPower) == cos( pi / (rootPower) ) + sin( pi / ( rootPower ) * i

some of you may or may not know that x ^ 1/2 == sqrt( x )... well you all know now. cube roots are ^1/3, and beyond is fun but not as easily identifiable to the human mind.