Cpomplex numbers

Beat Cornaz B.Cornaz at gmx.net
Thu Nov 12 05:41:45 EST 2009


Craig wrote :

 >I think, like dividing by 0, you cannot take square root of -1 in  
rev. So
 >there goes "i". No roots of any negative number in fact. I don't  
think it is
 >in the SANE world, if that is even still used. Probably not.

Hi Craig,

Rev does not need to be able to get the square root of -1 (or any  
negative number) to be able to do computations with Complex numbers.  
A complex number consists of a real part and an imaginary part :  
E.g.  3 + 2i where 'i' is the unit for the imaginary part. Now I can  
easily add another complex number to this one : (3 + 2i) + (7 - 8i) =  
10 - 6i. The real parts are added and the imaginary parts are added.  
Same goes for subtraction. Also multiplication and division are  
simple. Powers and higher roots are a bit more tricky and I guess  
logs etc as well. I have made a start with a library, but was  
thinking if someone has done this before, it would free some of my  
time for the things I want to use the lib for. I use the complex  
numbers to make transformations in the complex plane and Rieman  
sphere (Fractals, Möbius transformations etc.).
By the way, dividing by 0 in the realm complex numbers results to  
infinity. (That's what I always suspected in high school, but the  
teacher wouldn't budge).

Vice versa, if there is anyone who wants to have what I have up till  
now as library for this, I am glad to share. In the meantime, I still  
hope someone has made a library before me.

Cheers,
Beat



More information about the use-livecode mailing list