View Full Version : *I-M-A-G-E-N-A-R-Y Numbers*
DarkenedFire 01-04-2006, 09:54 PM :scream: i've recently stumbled across something in my programming where i needed to calculate something using imagenary numbers (i.e. †-4 which is 2¿) however i have found no way to do this in c++,,java,or darkbasic. does anybody know a way to make it not come up with a math error?
|
|
Cronholio
01-05-2006, 04:45 AM
Elaborate on exactly what it is you are trying to do and maybe someone can help. Generally you wouldn't work with imaginary numbers in a game, you'd provide an inline or global constant or solve the equation to eliminate the imaginary number.
DarkenedFire
01-06-2006, 05:13 PM
sorry about some of the symbols i guess i was using a font that not every system has so if you dont have "casiofx" it will look weird.
actually the reason im doing it is that im trying to make a casio gc emulator for my lap top so that i dont have to bring my calculator everywhere i go. it has a complex mode that can calculate imagenary numbers.
alona
01-06-2006, 07:42 PM
There are many standard math libraries in C++, and I'm sure for any other language, with classes that implement complex numbers (imaginary numbers are just a very special type of complex numbers). Google and you'll find it. However, it's quite easy to do it manually, basically a complex numbers is just a pair (a,b) of two real numbers, and there are simple formulas for adding, subtracting, multiplying, dividing, taking roots etc. The pair (a,b) represents the complex number a+bi where i is the square root of -1.
(a,b) + (c,d) = (a+c, b+d)
(a,b) - (c,d) = (a-c, b-d)
(a,b) * (c,d) = (ac-bd, ad+bc)
1 / (a,b) = (a/z, -b/z) where z=a^2+b^2
and so on...
AA
Kid-Mesh
01-07-2006, 11:43 AM
Operator overloading and a solid foundation on exactly what you are trying to do.
CGTalk Moderation
01-07-2006, 11:43 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.