00001 /* Copyright (C) 2002 Stefan Buehler <sbuehler@uni-bremen.de> 00002 00003 This program is free software; you can redistribute it and/or modify it 00004 under the terms of the GNU General Public License as published by the 00005 Free Software Foundation; either version 2, or (at your option) any 00006 later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00016 USA. */ 00017 00026 #include "complex.h" 00027 00028 complex<float> operator+ (const double &d, const complex<float> &c) 00029 { 00030 return (float(d) + c); 00031 } 00032 00033 complex<float> operator* (const double &d, const complex<float> &c) 00034 { 00035 return (float(d) * c); 00036 } 00037 00038 00039 complex<float> operator+ (const complex<float> &c, const double &d) 00040 { 00041 return (c + float(d)); 00042 } 00043 00044 complex<float> operator* (const complex<float> &c, const double &d) 00045 { 00046 return (c * float(d)); 00047 } 00048 00049 00050 00051 complex<double> operator+ (const float &f, const complex<double> &c) 00052 { 00053 return (double(f) + c); 00054 } 00055 00056 complex<double> operator* (const float &f, const complex<double> &c) 00057 { 00058 return (double(f) * c); 00059 } 00060 00061 complex<double> operator+ (const complex<double> &c, const float &f) 00062 { 00063 return (c + double(f)); 00064 } 00065 00066 complex<double> operator* (const complex<double> &c, const float &f) 00067 { 00068 return (c * double(f)); 00069 } 00070 00071 00072 // Complex asin( const Complex& a ) 00073 // { 00074 // const Complex i(0.0,-1.0); 00075 00076 // return i * log( i*a + sqrt(1.0-a*a)); 00077 // } 00078 00079 // Complex acos( const Complex& a ) 00080 // { 00081 // const Complex i(0.0,-1.0); 00082 00083 // return -i * log( a + i*sqrt(1.0-a*a)); 00084 // }