Crazy math

Discuss stuff not about Indigo.
Post Reply
14 posts • Page 1 of 1
User avatar
eman7613
Posts: 597
Joined: Sat Sep 16, 2006 2:52 pm

Crazy math

Post by eman7613 » Fri May 02, 2008 3:41 pm

So im working on some math code, namely complex numbers, and im writing compateTo, simple method right? wrong!

i > -i, this is true. and for any number a > b, a^2 > b^2, right? only makes sense, so i^2 > -i^2. BUT WAIT! this converts to, -1 > 1, which is not true! >.< evil complex numbers! does anyone know a lot about math who can explain this to me?
Yes i know, my spelling sucks

User avatar
Behrendt
Posts: 255
Joined: Wed Jun 28, 2006 8:30 pm
Location: Cologne, Germany
Contact:

Post by Behrendt » Fri May 02, 2008 5:43 pm

I think i > -i is wrong. What if i is a negative number?

remus
Indigo 100
Posts: 133
Joined: Fri May 02, 2008 8:07 am

Post by remus » Fri May 02, 2008 5:51 pm

Behhrendt, i think he's talking about i as in the square root of minus one rather than just a variable.

http://en.wikipedia.org/wiki/Complex_number

User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

Post by oodmb » Sat May 03, 2008 2:07 am

well, how are you representing your complex numbers?

(a+bi)^c ?

if that's how your doing it, comparing two complex numbers, or a complex number to a regular number is sort of meaningless, because these complex numbers are basically vectors on the complex plane, and you can't really compare two vectors. what you could do is compare there absolute values, or compare one component of the "vector" < a, b >.

if you are doing (a+bi)^c, you might want to do the math with the exponent first to produce just (a+bi).
in the case that a=0, b=1, and c=2, you'd have (0+1i)^2=i^2=(0+i)(0+i)=(-1+0i)^1

in the case of -i, you have a=0, b=-1, and c=1 so that -i=(0+-i)^1
in the case of i, you have a=0, b=1, and c=1 so that i=(0+i)^1
if the absolute value is compared, they are both equal, if only the a component is compared, then they are equal, if the b component is compared, you would have i>-i.

the reason complex numbers are represented this way is because i is not a real number, it's imaginary, it needs its own "number" line to represent it's magnitudes.

on a complete side note, the graph of the parametric function
x=real(i^t)
y=imaginary(i^t)
is a circle
a shiny monkey is a happy monkey

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sat May 03, 2008 4:08 am

for any number a > b, a^2 > b^2, right?
Wrong...
-0.5 > -2 , 0.25 !> 4 ! ;)
Maybe, it's true for the absolute values......

|-2| > |-0.5| , 4 > 0.25 :)

though, then you can't differ between negative and positive values anymore...
|-2| = |2| , 4 = 4

Oh, and the absolute value of a complex number x+yi = sqrt(x²+y²) which also eliminates any complex values.
The only numbers which remain are in "R{+,0}"

Stinkie
Indigo 100
Posts: 616
Joined: Sat Oct 27, 2007 9:22 pm

Post by Stinkie » Sat May 03, 2008 8:04 am

Wow! It's party time in here! Shall I pass the E?

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sat May 03, 2008 8:14 am

well the natural exponent will be needed for the complex numbers as well ;)
so will do the trig functions....

Stinkie
Indigo 100
Posts: 616
Joined: Sat Oct 27, 2007 9:22 pm

Post by Stinkie » Sat May 03, 2008 8:20 am

Sweet Lord! And I thought I was a nerd!

Oh well. As long as you math geeks are having fun, right? :wink:

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sat May 03, 2008 8:50 am

Ok... asking TI-92:

Code: Select all

(a + b i) ^ (c + d i) = cos (ln (a² + b²) d /2 - (2 arctan (a/b) - abs (b) / b pi) c / 2) e ^ (ln (a² + b²) c / 2 + arctan (a / b) d - abs (b) / b d pi / 2) + sin (ln ( a² + b²) d / 2 - (2 arctan (a / b) - abs (b) / b pi) c / 2) e ^(ln (a² + b²) c / 2 + arctan (a / b) d - abs (b) / b d pi / 2) i
or also...

Code: Select all

e ^ (i (ln (a² + b²) d / 2 - (2 arctan (a / b) - abs (b) / b pi) c / 2)) e ^ (ln (a² + b²) c / 2 + arctan (a / b) d - abs (b) / b  d pi /2)
Ok, hopefully I didn't make any mistake while typing^^

User avatar
oodmb
Posts: 271
Joined: Thu Oct 26, 2006 5:39 am
Location: USA
Contact:

Post by oodmb » Sat May 03, 2008 5:31 pm

how'd you make squared stuff into postscript ?
a shiny monkey is a happy monkey

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Sun May 04, 2008 12:39 am

AltGr + 2 on this keyboard...
As well as ³ ;)

User avatar
eman7613
Posts: 597
Joined: Sat Sep 16, 2006 2:52 pm

Post by eman7613 » Sun May 04, 2008 4:22 pm

ive got arbitray percision code for almost every math functions for complex numbers complete, im just trying to figure out the proper way to compare/ order complex numbers.

The problem with takeing the modulous is that compelx numbers changes order in a way that i dont think is okay. for exmaple: -2i, and 3. -2i's modulous would become 4, making it greater than 3, yet sqrt(-2) should remain less than three in ordering (at least i think so...).


Another problem is that i'm working with arbitrayer percision, id be waitying a long time for comparisons due to thee needed math since they are stored in a+bi format. I cant realy change it to another format, since storing it in polar form is costly for calculations & i loose a lot of accuracy, and exponential form has the same problems as polar, except maybe even more confusing to compare size of.


i cant seem to find any information of this outside of my own work, and my dad's old books are hard to read!
Yes i know, my spelling sucks

User avatar
OnoSendai
Developer
Posts: 6237
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Post by OnoSendai » Sun May 04, 2008 6:35 pm

I don't think there is just one way to order the complex numbers.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Mon May 05, 2008 6:11 am

Actually, complex numbers are said to be unorderable. Or better say, two dimensional orderable. You can't order them at a line - except if you take the absolute values ;)

Post Reply
14 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests