Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

## #1 2006-07-31 16:53:26

MathsIsFun
Registered: 2005-01-21
Posts: 7,630

### Complex Number Calculator

Indeed I have been working on a Complex Number Calculator

It can only do + - × / and ^ so far. And it may get those wrong.

I have had a lot of difficulty "parsing" and "walking" the formula, but I figure it is worth it - it is easier, and much more elegant, to write the formula than to enter the real and imaginary into different boxes and press function keys.

Could you pose it a few problems and see how it goes?

(Oh, and it is a real number calculator, too!)

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

## #2 2006-08-02 18:56:47

ryos
Member
Registered: 2005-08-04
Posts: 394

### Re: Complex Number Calculator

5^i = -0.0386319699339353+0.99925350682348i
i(54i-3i^3)^5 + 9i - i^i^i + 3 = 3+601692067i
Interpreted Formula: ((((UNKNOWN(((54*i)-(3*(i^3)))))^5)+(9*i))-((i^i)^i))+3
0i + 4i - 0^0 + 0^i - i^i^i^i^i^i = -1.20787957635076+4i
i/0 = NaNNaNi
i^2i^3i^4i^5i^6i^7i^8i^9i = i
i^(2i*3i*4i*5i*6i*7i*8i*9i) = 1

I have no idea if any of these are right or wrong, but it seems to handle all sorts of weird things. (The last two seem contradictory, though.)

El que pega primero pega dos veces.

Offline

## #3 2006-08-02 19:21:28

luca-deltodesco
Member
Registered: 2006-05-05
Posts: 1,470

### Re: Complex Number Calculator

ryos wrote:

i^2i^3i^4i^5i^6i^7i^8i^9i = i
i^(2i*3i*4i*5i*6i*7i*8i*9i) = 1

(The last two seem contradictory, though.)

maybe thats because the first one is (i^2)*(i^3)*(i^4) and not the second one which would be i^(2i)^(3i)

The Beginning Of All Things To End.
The End Of All Things To Come.

Offline

## #4 2006-08-02 20:21:56

MathsIsFun
Registered: 2005-01-21
Posts: 7,630

### Re: Complex Number Calculator

ryos wrote:

Interpreted Formula: ((((UNKNOWN(((54*i)-(3*(i^3)))))^5)+(9*i))-((i^i)^i))+3

Well that one is obviously wrong, because it thinks i() is a function - I shall have to teach it otherwise

I hope to extend the functions it knows to sin, cos, sinh, etc etc

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

## #5 2007-02-09 11:17:50

MathsIsFun
Registered: 2005-01-21
Posts: 7,630

### Re: Complex Number Calculator

OK I have added a heap of functions to the Complex Number Calculator.

I have done some testing, but I need more done ... please

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

## #6 2007-02-09 11:28:16

kylekatarn
Member
Registered: 2005-07-24
Posts: 445

### Re: Complex Number Calculator

I typed
5+6[ENTER]
and the text disappeared.

Isn't it supposed to perform the calculation with [ENTER]?

Offline

## #7 2007-02-09 11:46:21

MathsIsFun
Registered: 2005-01-21
Posts: 7,630

### Re: Complex Number Calculator

What a good idea ... I have made it respond to the Enter Key.

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

## #8 2007-02-09 12:18:02

mathsyperson
Moderator
Registered: 2005-06-22
Posts: 4,900

### Re: Complex Number Calculator

Very nice calculator. Here's something that I think might be weird, but I could have easily made a mistake.

Ryos's post made me decide to try out i^i. Its answer for that is ~0.2 + 0i.

It's a standard identity that e^(iθ) = cosθ + isinθ.
Therefore, i = e^(i*π/4)

Substituting this into the original gives [e^(i*π/4)]^i.
Using the laws of indices, we can the turn that into e^i²π/4 = e^-π/4.
But then putting that into the calculator gives you ~0.7 + 0i, even though it's equivalent to i^i.

Have I gone wrong somewhere?

Why did the vector cross the road?
It wanted to be normal.

Offline

## #9 2007-02-09 12:48:00

Ricky
Moderator
Registered: 2005-12-04
Posts: 3,791

### Re: Complex Number Calculator

It's a standard identity that e^(iθ) = cosθ + isinθ.
Therefore, i = e^(i*π/4)

sin(pi/4) ≠ 1

"In the real world, this would be a problem.  But in mathematics, we can just define a place where this problem doesn't exist.  So we'll go ahead and do that now..."

Offline

## #10 2007-02-09 19:11:41

MathsIsFun
Registered: 2005-01-21
Posts: 7,630

### Re: Complex Number Calculator

Slightly newer version (v0.91). Should be able to type in e^(-pi/4) and it figures out the right order of calculation.

I also added a "cis" format button so you can see the result in polar form. Fun with e^() type entries.

"The physicists defer only to mathematicians, and the mathematicians defer only to God ..."  - Leon M. Lederman

Offline

## #11 2007-02-17 00:06:07

ganesh
Moderator
Registered: 2005-06-28
Posts: 21,730

### Re: Complex Number Calculator

Outstanding!
The Complex Number Calculator is very good, very well created!
Initially (that was some days back), I couldn't see the number keys and the operation keys.
I used the keyboard keys, the calculator works perfectly well!
I even tried functions like  e^(i*pi) and found the results correct!
Commendable work, MathsIsFun!

It is no good to try to stop knowledge from going forward. Ignorance is never better than knowledge - Enrico Fermi.

Nothing is better than reading and gaining more and more knowledge - Stephen William Hawking.

Offline