# [PD] imaginary numbers

brandt at subnet.at brandt at subnet.at
Sat Aug 29 12:32:30 CEST 2009

```Thank you very much

as i am on windows, unfortunally there is no gridflow. - and i tried to
make sqrt from pd, but it does not like -1.

thanks again
der.brandt

> On Fri, 28 Aug 2009, brandt at subnet.at wrote:
>
>> how is it possible to calculate with imaginary numbers in PD besides the
>> fft stuff.
>
> basically, if you know that something is an imaginary number, you can use
> a real number in its place and just remember to multiply by square root of
>
> but if you want to combine real and imaginary numbers, then you need
> complex numbers, each of which is a real and an imaginary number.
>
> let i be sqrt(-1)... then let's say you have two complex numbers, a+bi,
> c+di, as four floats. the sum is (a+c)+(b+d)i, that is you add the real
> parts together, and add the imaginary parts together. From this, you can
> guess how to subtract. The product formula is (a*c-b*d)+(a*d+b*c)i, which
> you can often see in Miller's FFT patches as a cluster of four [*~].
>
> You can find more such formulas on Wikipedia, PlanetMath, MathWorld, or
> other, but if you can't find one or have trouble getting one to work, ask
> pd-list again.
>
> Abstractions could have been made for some of these, especially *, /, exp,
> log, but I don't think any such library exists. GridFlow provides those
> operations as an external if you need something fast.
>
>   _ _ __ ___ _____ ________ _____________ _____________________ ...
> | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801

```