Complex modulus? No, not the absolute value.

591 Views Asked by At

I was trying to make a class for complex numbers (VB.NET) but then I stumbled upon a problem. How do I define the $mod$ operator for Complex numbers?

First I asked Wolfram Alpha. It didn't help much. (But at least it told me it was possible to define).

Then, I searched Google, which didn't help much either. The most I found was this. Didn't help to clarify.

So I want to ask if any of you know how I could extend the $mod$ operator to the Complex numbers. Any help would be appreciated.

(P.S. I saw this question but I didn't see how the accepted answer answered it. What I want is a general formula for complex numbers.)

1

There are 1 best solutions below

3
On BEST ANSWER

I tried using some modulus formulas but they didn't give the same results as W|A. Then I tried using the "alternate representations". They didn't give the same results! I figured out it was a bug and managed to make this general formula: $$(a+bi)\bmod (c+di)=a+bi+(c+di)\lceil-\frac{a+bi}{c+di}\rceil$$ Hope this helps someone else!

P.S. $\lceil a+bi\rceil = \lceil a\rceil + \lceil b\rceil i$