BUG: Complex number result depends on input format.

Greg Bell shared this problem 2 years ago
Not a Problem

Y1 and Y2 are the same formula, but they differ because the display format for X1 and X2 differ. This should not be so! 5 - 5 should = 0 whether its 5, 5+0i, or (5;0)


See attached or https://www.geogebra.org/cl... (same file)


Related to, but simpler than, https://help.geogebra.org/t...

Comments (13)

photo
1

Sorry, that's expected. (Especially for a*b)

photo
1

Can you please elaborate? Is there a definition of "real number minus point" that I'm missing?

photo
1

Yes, we've chosen a particular definition. It's not right or wrong - just a choice

photo
1

Sorry, but that seems wrong. 5+0i can be represented in polar coords as (5;0 deg), and if you plot it, it would be a point at (5, 0).


I should be able to subtract any two of those things and have it treated as a vector subtraction equalling 0 + 0i.

photo
1

(5 + 0ί) - (5;0)
seems OK to me

photo
1

Yes, but why doesn't that work if 5 is real? After all (5 + 0i) is just a real 5 with a null imaginary part.


And why does the result, if 5 is real, change with the display format?

photo
photo
1

No me lo puedo creer 5-5 != 0

I think you have read wrong the Y1 definition; Y1=5-X1. there is not some * in the file

photo
1

There does not need to be a *. The example shows two different results depending on the format chosen for X1 and X2.

photo
1

michael means that GG mapps the real over the complex

ie: (3,4)+5==(8,9) so (3+4i)+5==8+9i

photo
1

Sorry, wrong. (3+4i)+5==8+4i in GG

photo
1

please, try z_1=3+4i then polar form for z_1, then z_2=z_1+5 then complex form for z_2

photo
1

I think you meant to change z1 from polar to complex form, and, yes, z2 changes. Which is exactly my point. I don't understand why the input display format should change the output.


The answer probably is that it's not the input display format, but rather whether it's a complex number or a polar coordinate point. In that case I don't understand the maths / logic for when a real is mixing with a point vs. a complex number.

But that's me conjecturing, trying to answer my own question. Is it safe to say this needs to be explained in the documentation somewhere?

photo
photo
1

Michael - I was delighted to get some dialog going about this, but apparently I've killed it.


If it's not a bug, if I could just understand the logic behind the behavior (or the math), that would be great.

© 2023 International GeoGebra Institute