Subject: Complex arithmetic and quaternion arithmetic             
                                                                              
   Q8a: How does complex arithmetic work?                                     
   A8a: It works mostly like regular algebra with a couple additional         
formulas: (note: a, b are reals, x, y are complex, i is the square root of -1)
                                                                              
   Powers of i:                                                               
          i^2 = -1                                                            
                                                                              
   Addition:                                                                  
          (a+i*b)+(c+i*d) = (a+c)+i*(b+d)                                     
                                                                              
   Multiplication:                                                            
          (a+i*b)*(c+i*d) = a*c-b*d + i*(a*d+b*c)                             
                                                                              
   Division:                                                                  
          (a+i*b) / (c+i*d) = (a+i*b)*(c-i*d) / (c^2+d^2)                     
                                                                              
   Exponentiation:                                                            
          exp(a+i*b) = exp(a)*(cos(b)+i*sin(b))                               
                                                                              
   Sine:                                                                      
          sin(x) = (exp(i*x) - exp(-i*x)) / (2*i)                             
                                                                              
   Cosine:                                                                    
          cos(x) = (exp(i*x) + exp(-i*x)) / 2                                 
                                                                              
   Magnitude:                                                                 
          |a+i*b| = sqrt(a^2+b^2)                                             
                                                                              
   Log:                                                                       
        log(a+i*b) = log(|a+i*b|)+i*arctan(b / a) (Note: log is multivalued.) 
                                                                              
   Log (polar coordinates):                                                   
          log(r e^(i*a)) = log(r)+i*a                                         
                                                                              
   Complex powers:                                                            
          x^y = exp(y*log(x))                                                 
                                                                              
   de Moivre's theorem:                                                       
          x^n = r^n [cos(n*a) + i*sin(n*a)] (where n is an integer)           
                                                                              
   More details can be found in any complex analysis book.                    
                                                                              
   Q8b: How does quaternion arithmetic work?                                  
   A8b: quaternions have 4 components (a + ib + jc + kd) compared to the two  
of complex numbers. Operations such as addition and multiplication can be     
performed on quaternions, but multiplication is not commutative.              
                                                                              
   Quaternions satisfy the rules                                              
                                                                              
     * i^2 = j^2 = k^2 = -1                                                   
     * ij = -ji = k                                                           
     * jk = -kj = i,                                                          
     * ki = -ik = j                                                           
                                                                              
   See:                                                                       
                                                                              
   Frode Gill's quaternions page                                              
          http://www.krs.hia.no/~fgill/quatern.html                           
                                                                              


HyperText/CGI-HTML, v. 3.6.4 (C)1994-2000 M.Zakharov