Have you ever used imaginary numbers in code?

1    19 Feb 2017 14:20 by u/wesofx

AFAIK sqrt(-1) doesn't compile. If I wasn't told otherwise in school, I'd say sqrt(-1) is undefined and useless. Have you ever done anything productive with imaginary numbers in code?

2 comments

2

Frequency analysis in images, and audio. And yeah, a place holder "im" is usually enough to do the equations needed.

2

If your language is built right, then you vectorize the value and can handle it. So sqrt(i) or whatever your vector field looks like. Should be info online somewhere that tells you how to do it.