|
CMATH
This page describes the following products:
Contents1. Introduction1.1 C/C++ Specifics 1.2 Pascal/Delphi Specifics 2. Overview over the Functions of CMATH 2.1 Initialization of Complex Numbers 2.2 Data-Type Interconversions 2.3 Basic Complex Operations 2.4 Arithmetic Operations 2.5 Mathematical Functions 3. Error Handling 3.1 General Error Handling of Complex Functions 3.1.1 C/C++ Specifics 3.1.1 Pascal/Delphi Specifics 3.2 Writing Error Messages into a File 4. Syntax Reference 4.1 Plain-C, Pascal/Delphi Functions 4.2 Overloaded C++/Delphi Functions 1. IntroductionCMATH is a comprehensive library for complex-number arithmetics and mathematics, both in cartesian and in polar coordinates, for C/C++ and Pascal/Delphi compilers. CMATH is available as a stand-alone product. It is also included in the OptiVec package.All functions may alternatively be called from classic C and Pascal/Delphi with type-specific function names (like cf_sin, cd_exp, pe_sqrt), or from C++ and Delphi with overloaded function names and operators (like sin, exp, sqrt, operator +; operators only in C++). As far as possible, all functions have the same names in the Pascal/Delphi version as in the C/C++ version. Superior speed, accuracy and safety are achieved through the implementation in Assembly language (as opposed to the compiled or inline code of available complex C++ class libraries). Only for the most simple tasks, alternative inline C++ functions are used in the C++ version. As far as the scope of CMATH overlaps with the complex class implementations of Visual C++, C++ Builder (former Borland C++), and Delphi, CMATH is a high-quality replacement for the latter, which are all quite inefficient and inaccurate. In contrast to the written-down-and-compiled textbook formulas of most other available complex libraries (including those coming with Visual C++ and the Borland compilers), the implementation of CMATH was guided by the following rules:
Back to CMATH Table of Contents OptiVec home 1.1 C/C++ SpecificsThe complex C++ classes and the C structs fComplex etc. are binary compatible with each other. This point may become important for large projects with mixed C and C++ modules. Existing C++ code which uses the complex class library, contained in <complex.h>, can be left unchanged, because the CMATH functions and data types are also binary compatible with those of <complex.h>. The single exception is the member function polar, which had to be replaced by magargtoc, as the word "polar" now denotes the complex classes in polar coordinates.Here is a detailed description of how to use CMATH in your projects:
Back to CMATH Table of Contents OptiVec home 1.2 Delphi SpecificsCMATH for Delphi defines six complex data types:
The reason why the single-precision type gets the name fComplex instead of sComplex is that the letter "s" is already over-used by ShortInt and SmallInt in Pascal/Delphi. Therefore, this name is derived from the C/C++ analogue of Single, which is float. The CMATH-Delphi data types are binary compatible with those of the C/C++ versions. The type-specific function names are the same as in the plain-C version. The syntax, however, is somewhat different, as C supports complex numbers (defined as structs) as return values, whereas Pascal and early Delphi versions originally did not allow records to be returned by a function (this is allowed only in Delphi). Therefore, they are passed as var arguments to the complex functions, e.g.
The overloaded function names are the same as in the C++ version. Here, the results are treated as true return values, e.g.
Back to CMATH Table of Contents OptiVec home 2. Overview over the Functions of CMATHIn the following, it is often only the fComplex or fPolar version of a function that is explicitly mentioned. The versions for dComplex / dPolar, and eComplex / ePolar are always exactly analogous.All functions for the languages C and Pascal/Delphi have a prefix denoting the data type on which the function works: "cf_" or "pf_" stands for single precision (arguments and return values of the data types fComplex, fPolar, sometimes together with float), "cd_" or "pd_" stands for double precision (arguments and return values of the data types dComplex, dPolar, sometimes together with double), whereas "ce_" and "pe_" denote extended-precision functions. In C++ and Delphi, synonyms are defined for all these functions. The synonyms do not have a prefix, since the data type information is implicitly handled by the compiler. The overloaded function names are mostly identical to those found in the complex class libraries (if the respective function exists there). Note, however, that the member function polar had to be replaced by magargtoc, as the name "polar" is now reserved for the polar classes. C++ only: If you wish to use the C function names in your C++ modules, be sure to include <cmath.h> instead of <newcplx.h>. 2.1. Initialization of Complex NumbersIn the following, we denote the complex classes by by their short names, fComplex, fPolar, etc. In C++, you can always use the template nomenclature instead, writing "complex<float>" wherever "fComplex" is written here, and so on for all other complex types and classes. Complex numbers are initialized by separately assigning a value to the imaginary and real parts, e.g.:
Delphi:
For double-precision complex numbers, use dcplx and dpolr, for extended-precision complex numbers, use ecplx and epolr. 2.2. Data-Type Interconversions
Interconversions between the various complex types are performed via the functions:
OVERFLOW conditions in the course of down-conversions are silently handled by setting the result to the largest value possible.
A special constructor for polar numbers is fPolar pf_principal( fPolar __p ); and, for C++ only, its overloaded form for two separate real input numbers fPolar principal( float Mag, float Arg ); These functions reduce the input Arg to the range -p < Arg <= +p. You might recall that each complex number has an infinite number of representations in polar coordinates, with the angles differing by an integer multiple of 2 p. The representation with -p < Arg <= +p is called the principal value. Please note that these are the only polar functions reducing the output to the principal value. All others accept and return arguments whose angles may fall outside this range. The conversion between cartesian and polar format involves transcedental functions and is, therefore, quite time-consuming. It is true that multiplications are faster in polar coordinates, whereas additions are much faster in Cartesian. The difference, however, is so much smaller than the cost of switching back and forth between the different representations, that we recommend you stay in general with the cartesian format. Only in the following cases, the conversion really makes sense:
Back to CMATH Table of Contents OptiVec home 2.3 Basic Complex OperationsThe following basic complex operations are defined in CMATH:
(The double and extended-precision versions are exactly analogous to the cf_ / pf_ version) Back to CMATH Table of Contents OptiVec home 2.4 Arithmetic Operations
Additionally, all arithmetic operations of complex numbers are implemented as functions which actually provide the most efficient implementation:
(similarly the double- and extended-precision versions) The assignment operator "=" or ":=" is the only operator defined also in plain-C for complex numbers. Back to CMATH Table of Contents OptiVec home 2.5 Mathematical FunctionsCMATH contains all mathematical functions you would find in the complex class libraries of C++, along with several additional ones:
As noted above, the exponential and logarithm functions provide a natural transition between cartesian and polar coordinates. While there are exp and log functions for fComplex as argument and as return value, cf_exptop takes an fComplex argument and returns fPolar. In the opposite direction, pf_logtoc takes an fPolar argument and returns fComplex. Back to CMATH Table of Contents OptiVec home 3. Error Handling3.1 General Error Handling of Complex FunctionsThe error handling of complex functions follows the rules employed generally also for real-number functions and operations. For all arithmetic operations, the design of the algorithms eliminates the danger of failure due to irregular intermediate results. Overflowing or otherwise irregular final results, however, will lead to a hardware interrupt being generated and, as a consequence, to a program abort.In contrast to the arithmetic operations, all mathematical functions perform a tight error checking. All error messages eventually generated use the C/Pascal name (rather than the overloaded C++/Delphi name) of the failing function. 3.1.1 C/C++ SpecificsAll error conditions in CMATH math functions are handled the old-fashioned, but most flexible and efficient way via _matherr (for fComplex and dComplex functions) and _matherrl (for eComplex functions; 32-bit Borland C++ only). The Re or Mag part of the complex argument, causing an error is stored in e->x and the Im or Arg part in e->y.Back to CMATH Table of Contents OptiVec home 3.1.2 Pascal/Delphi SpecificsHow CMATH handles floating-point errors in the complex math functions is defined by a call to V_setFPErrorHandling. A number of pre-defined constants fperrXXX is available for the construction of the desired error-handling mode:
Example: V_setFPErrorHandling( fperrAbortDOMAIN + fperrAbortSING + fperrAbortOVERFLOW + fperrNoteTLOSS ); In this example, program execution will be aborted (with the appropriate message) in the case of the most severe errors, DOMAIN and SING. In the case of OVERFLOW and TLOSS errors, a warning will be displayed, but program execution will be continued with default results set by the respective functions where the errors occur. The repeated occurrence of the same type of error within one and the same function will lead to only one message being generated. Subsequent errors will be treated silently. Back to CMATH Table of Contents OptiVec home 3.2 Writing Error Messages into a FileThe function V_setErrorEventFile provides a means to decide if you wish your error messages to appear on the screen and/or in a log file. This function needs as arguments the desired name of your event file and a switch named ScreenAndFile which decides if you wish to have error messages printed simultaneously into the file and onto the screen (ScreenAndFile = TRUE (non-zero)) or exclusively into the file (ScreenAndFile = FALSE (0)).Back to CMATH Table of Contents OptiVec home 4. Syntax ReferenceExcept for the data-type conversion functions, only the float / fComplex / fPolar syntax is given. The syntax of the functions for double and extended precisions is exactly analogous.If you chose the "classic" class complex, this is also similar. Just replace "float" by "double" and "fComplex" by "complex". No polar functions are available in the "classic" class complex, neither do any of the type-casting operators and interconversion functions exist, if there is only one type. Back to CMATH Table of Contents OptiVec home 4.1 Plain-C, Pascal/Delphi FunctionsFor the functions of double / dComplex / dPolar and extended / eComplex / ePolar precision, the prefixes are cd_, pd_, ce_, and pe_, respectively.float cf_abs( fComplex __z ); function cf_abs( zx:fComplex ): Single; float pf_abs( fPolar __p ); function pf_abs( px:fPolar ): Single; fComplex cf_acos( fComplex __z ); procedure cf_acos( var zy:fComplex; zx:fComplex ); fComplex cf_add( fComplex __x, fComplex __y ); procedure cf_add( var zz:fComplex; zx, zy:fComplex ); fComplex cf_addRe( fComplex __x, float __yRe ); procedure cf_addRe( var zz:fComplex; zx:fComplex; yRe:Single ); float cf_arg( fComplex __z ); function cf_arg( zx:fComplex ): Single; float pf_arg( fPolar __z ); function pf_arg( px:fPolar ): Single; fComplex cf_asin( fComplex __z ); procedure cf_asin( var zy:fComplex; zx:fComplex ); fComplex cf_atan( fComplex __z ); procedure cf_atan( var zy:fComplex; zx:fComplex ); eComplex cdtoce( dComplex __zd ); procedure cdtoce( var zy:eComplex; zx:dComplex ); fComplex cdtocf( dComplex __zd ); procedure cdtocf( var zy:fComplex; zx:dComplex ); dPolar cdtopd( dComplex __zd ); procedure cdtopd( var py:dPolar; zx:eComplex ); ePolar cdtope( dComplex __zd ); procedure cdtope( var py:ePolar; zx:eComplex ); fPolar cdtopf( dComplex __zd ); procedure cdtope( var py:fPolar; zx:eComplex ); dComplex cetocd( eComplex __ze ); procedure cetocd( var zy:dComplex; zx:eComplex ); fComplex cetocf( eComplex __ze ); procedure cetocf( var zy:fComplex; zx:eComplex ); dPolar cetopd( eComplex __ze ); procedure cetopd( var py:dPolar; zx:eComplex ); ePolar cetope( eComplex __ze ); procedure cetope( var py:ePolar; zx:eComplex ); fPolar cetopf( eComplex __ze ); procedure cetopf( var py:fPolar; zx:eComplex ); dComplex cftocd( fComplex __zf ); procedure cftocd( var zy:dComplex; zx:fComplex ); eComplex cftoce( fComplex __zf ); procedure cftoce( var zy:eComplex; zx:fComplex ); dPolar cftopd( fComplex __zf ); procedure cftopd( var py:dPolar; zx:fComplex ); ePolar cftope( fComplex __zf ); procedure cftope( var py:ePolar; zx:fComplex ); fPolar cftopf( fComplex __zf ); procedure cftopf( var py:fPolar; zx:fComplex ); fComplex cf_conj( fComplex __z ); procedure cf_conj( var zy:fComplex; zx:fComplex ); fPolar pf_conj( fPolar __p ); procedure pf_conj( var py:fPolar; px:fPolar ); fComplex cf_cos( fComplex __z ); procedure cf_cos( var zy:fComplex; zx:fComplex ); fComplex cf_cosh( fComplex __z ); procedure cf_cosh( var zy:fComplex; zx:fComplex ); fComplex cf_cubic( fComplex __z ); procedure cf_cubic( var zy:fComplex; zx:fComplex ); fPolar pf_cubic( fPolar __p ); procedure pf_cubic( var py:fPolar; px:fPolar ); fComplex cf_div( fComplex __x, fComplex __y ); procedure cf_div( var zz:fComplex; zx, zy:fComplex ); fPolar pf_div( fPolar __x, fPolar __y ); procedure pf_div( var pz:fPolar; px, py:fPolar ); fComplex cf_divRe( fComplex __x, float __yRe ); /* x / yRe */ procedure cf_divRe( var zz:fComplex; zx:fComplex; yRe:Single ); fPolar pf_divRe( fPolar __x, float __yRe ); /* x / yRe */ procedure pf_divRe( var pz:fPolar; px:fPolar; yRe:Single ); fComplex cf_divrRe( fComplex __x, float __yRe ); /* yRe / x */ procedure cf_divrRe( var zz:fComplex; zx:fComplex; yRe:Single ); fPolar pf_divrRe( fPolar __x, float __yRe ); /* yRe / x */ procedure pf_divrRe( var pz:fPolar; px:fPolar; yRe:Single ); fComplex cf_exp( fComplex __z ); procedure cf_exp( var zy:fComplex; zx:fComplex ); fPolar cf_exptop( fComplex __z ); procedure cf_exptop( var py:fPolar; zx:fComplex ); fComplex fcplx( float __ReVal, float __ImVal); procedure fcplx( var zy:fComplex; xRe, xIm:Single ); fPolar fpolr( float __MagVal, float __ArgVal); procedure fpolr( var py:fPolar; xMag, xArg:Single ); float cf_imag( fComplex __z ); function cf_imag( zx:fComplex ): Single; float pf_imag( fPolar __p ); function pf_imag( px:fPolar ): Single; fComplex cf_inv( fComplex __z ); procedure cf_inv( var zy:fComplex; zx:fComplex ); fPolar pf_inv( fPolar __p ); procedure pf_inv( var py:fPolar; zx:fComplex ); fComplex cf_ipow( fComplex __z, int __exponent ); procedure cf_ipow( var zy:fComplex; zx:fComplex; exponent:Integer ); fPolar pf_ipow( fPolar __p, int __exponent ); procedure pf_ipow( var py:fPolar; px:fPolar; exponent:Integer ); fComplex cf_ln( fComplex __z ); procedure cf_ln( var zy:fComplex; zx:fComplex ); fComplex pf_lntoc( fPolar __p ); procedure pf_lntoc( var zy:fComplex; zx:fPolar ); fComplex cf_log( fComplex __z ); procedure cf_log( var zy:fComplex; zx:fComplex ); fComplex pf_logtoc( fPolar __p ); procedure pf_logtoc( var zy:fComplex; zx:fPolar ); fComplex cf_log2( fComplex __z ); procedure cf_log2( var zy:fComplex; zx:fComplex ); fComplex pf_log2toc( fPolar __p ); procedure pf_log2toc( var zy:fComplex; zx:fPolar ); fComplex cf_log10( fComplex __z ); procedure cf_log10( var zy:fComplex; zx:fComplex ); fComplex pf_log10toc( fPolar __p ); procedure pf_log10toc( var zy:fComplex; zx:fPolar ); fComplex cf_magargtoc( float __mag, float __angle ); procedure cf_magargtoc( var zy:fComplex; mag, angle:Single ); fComplex cf_mul( fComplex __x, fComplex __y ); procedure cf_mul( var zz:fComplex; zx, zy:fComplex ); fPolar pf_mul( fPolar __x, fPolar __y ); procedure pf_mul( var zz:fPolar; zx, zy:fPolar ); fComplex cf_mulRe( fComplex __x, float __yRe ); procedure cf_mulRe( var zz:fComplex; zx:fComplex; yRe:Single ); fPolar pf_mulRe( fPolar __x, float __yRe ); procedure pf_mulRe( var zz:fPolar; zx:fPolar; yRe:Single ); fComplex cf_neg( fComplex __z ); procedure cf_neg( var zy:fComplex; zx:fComplex ); fPolar pf_neg( fPolar __p ); procedure pf_neg( var py:fPolar; px:fPolar ); float cf_norm( fComplex __z ); function cf_norm( zx:fComplex ): Single; float pf_norm( fPolar __p ); function pf_norm( px:fPolar ): Single; dComplex pdtocd( dPolar __pd ); procedure pdtocd( var zy:dComplex; px:dPolar ); eComplex pdtoce( dPolar __pd ); procedure pdtoce( var zy:eComplex; px:dPolar ); fComplex pdtocf( dPolar __pd ); procedure pdtocf( var zy:fComplex; px:dPolar ); ePolar pdtope( dPolar __pd ); procedure pdtope( var zy:ePolar; zx:dPolar ); fPolar pdtopf( dPolar __pd ); procedure pdtopf( var zy:fPolar; zx:dPolar ); dComplex petocd( ePolar __pe ); procedure petocd( var zy:dComplex; px:ePolar ); eComplex petoce( ePolar __pe ); procedure petoce( var zy:eComplex; px:ePolar ); fComplex petocf( ePolar __pe ); procedure petocf( var zy:fComplex; px:ePolar ); dPolar petopd( ePolar __pe ); procedure petopd( var zy:dPolar; zx:ePolar ); fPolar petopf( ePolar __pe ); procedure petopf( var zy:fPolar; zx:ePolar ); dComplex pftocd( fPolar __pf ); procedure pftocd( var zy:dComplex; px:fPolar ); eComplex pftoce( fPolar __pf ); procedure pftoce( var zy:eComplex; px:fPolar ); fComplex pftocf( fPolar __pf ); procedure pftocf( var zy:fComplex; px:fPolar ); dPolar pftopd( fPolar __pf ); procedure pftopd( var zy:dPolar; zx:fPolar ); ePolar pftope( fPolar __pf ); procedure pftope( var zy:ePolar; zx:fPolar ); fComplex cf_polar( float mag, float arg ); /* same as cf_magargtoc */ procedure cf_polar( var zy:fComplex; mag, arg:Single ); fComplex cf_pow( fComplex __base, fComplex __exponent ); procedure cf_pow( var zy:fComplex; zx:fComplex; exponent:Integer ); fComplex cf_powReBase( float __base, fComplex __exponent ); procedure cf_powReBase( var zy:fComplex; base:Single; exponent:fComplex ); fComplex cf_powReExpo( fComplex __base, float __exponent ); procedure cf_powReExpo( var zy:fComplex; zx:fComplex; exponent:Single ); fPolar pf_powReExpo( fPolar __base, float __exponent ); procedure pf_powReExpo( var py:fPolar; px:fPolar; exponent:Single ); fComplex cf_quartic( fComplex __z ); procedure cf_quartic( var zy:fComplex; zx:fComplex ); fPolar pf_quartic( fPolar __p ); procedure pf_quartic( var py:fPolar; zx:fPolar ); float cf_real( fComplex __z ); function cf_real( zx:fComplex ): Single; float pf_real( fPolar __p ); function pf_real( px:fPolar ): Single; fComplex cf_sin( fComplex __z ); procedure cf_sin( var zy:fComplex; zx:fComplex ); fComplex cf_sinh( fComplex __z ); procedure cf_sinh( var zy:fComplex; zx:fComplex ); fComplex cf_square( fComplex __z ); procedure cf_square( var zy:fComplex; zx:fComplex ); fPolar pf_square( fPolar __p ); procedure pf_square( var py:fPolar; zx:fPolar ); fComplex cf_sqrt( fComplex __z ); procedure cf_sqrt( var zy:fComplex; zx:fComplex ); fPolar pf_sqrt( fPolar __p ); procedure pf_sqrt( var py:fPolar; px:fPolar ); fComplex cf_sub( fComplex __x, fComplex __y ); procedure cf_sub( var zz:fComplex; zx, zy:fComplex ); fComplex cf_subRe( fComplex __x, float __yRe ); /* x - yRe */ procedure cf_subRe( var zz:fComplex; zx:fComplex; yRe:Single ); fComplex cf_subrRe( fComplex __x, float __yRe ); /* yRe - x */ procedure cf_subrRe( var zz:fComplex; zx:fComplex; yRe:Single ); fComplex cf_tan( fComplex __z ); procedure cf_tan( var zy:fComplex; zx:fComplex ); fComplex cf_tanh( fComplex __z ); procedure cf_tanh( var zy:fComplex; zx:fComplex ); Back to CMATH Table of Contents OptiVec home 4.2 Overloaded C++/Delphi Functionsfloat abs( fComplex _z );function abs( zx:fComplex ): Single; float abs( fPolar _p ); function abs( px:fPolar ): Single; fComplex acos( fComplex _z ); function acos( zx:fComplex ): fComplex; function add( zx, zy:fComplex ): fComplex; function add( zx:fComplex; yRe:Single ): fComplex; function add( yRe:Single; zx:fComplex ): fComplex; function addRe( zx:fComplex; yRe:Single ): fComplex; float arg( fComplex _z ); function arg( zx:fComplex ): Single; float arg( fPolar _p ); function arg( px:fPolar ): Single; fComplex asin( fComplex _z ); function asin( zx:fComplex ): fComplex; fComplex atan( fComplex _z ); function atan( zx:fComplex ): fComplex; fComplex conj( fComplex _z ); function conj( zx:fComplex ): fComplex; fPolar conj( fPolar _p ); function conj( px:fPolar ): fPolar; fComplex cos( fComplex _z ); function cos( zx:fComplex ): fComplex; fComplex cosh( fComplex _z ); function cosh( zx:fComplex ): fComplex; fComplex cubic( fComplex _z ); function cubic( zx:fComplex ): fComplex; fPolar cubic( fPolar _p ); function cubic( px:fPolar ): fPolar; function divide( zx, zy:fComplex ): fComplex; function divide( zx:fComplex; yRe:Single ): fComplex; function divide( yRe:Single; zx:fComplex ): fComplex; function divide( px, py:fPolar ): fPolar; function divide( px:fPolar; yRe:Single ): fPolar; function divide( yRe:Single; px:fPolar ): fPolar; function divRe( zx:fComplex; yRe:Single ): fComplex; function divRe( px:fPolar; yRe:Single ): fPolar; function divrRe( zx:fComplex; yRe:Single ): fComplex; function divrRe( px:fPolar; yRe:Single ): fPolar; fComplex exp( fComplex _z ); function exp( zx:fComplex ): fComplex; fPolar exptop( fComplex _z ); function exptop( zx:fComplex ): fPolar; fComplex fComplex( float Re_part, float Im_part=0 ); fComplex fComplex( dComplex cd ); fComplex fComplex( eComplex ce ); // type-casting constructors fComplex fComplex( fPolar pf ); // interconversion from polar fComplex fComplex( dPolar pd ); fComplex fComplex( ePolar pe ); float imag(); // to be used as zim = z.imag(); float imag( fComplex _z ); // to be used as zim = imag( z ); function imag( zx:fComplex ): Single; float imag( fPolar _p ); function imag( px:fPolar ): Single; fComplex inv( fComplex _z ); function inv( zx:fComplex ): fComplex; fPolar inv( fPolar _p ); function inv( px:fPolar ): fPolar; fComplex ipow( fComplex __base, int __expon ); function ipow( zx:fComplex; exponent:Integer ): fComplex; fPolar ipow( fPolar __base, int __expon ); function ipow( px:fPolar; exponent:Integer ): fPolar; fComplex ln( fComplex _z ); function ln( zx:fComplex ): fComplex; fComplex lntoc( fPolar _p ); function lntoc( px:fPolar ): fComplex; fComplex log( fComplex _z ); function log( zx:fComplex ): fComplex; fComplex logtoc( fPolar _p ); function logtoc( px:fPolar ): fComplex; fComplex log2( fComplex _z ); function log2( zx:fComplex ): fComplex; fComplex log2toc( fPolar _p ); function log2toc( px:fPolar ): fComplex; fComplex log10( fComplex _z ); function log10( zx:fComplex ): fComplex; fComplex log10toc( fPolar _p ); function log10toc( px:fPolar ): fComplex; fComplex magargtoc( float _mag, float _angle ); function magargtoc( mag, angle:Single ): fComplex; function mul( zx, zy:fComplex ): fComplex; function mul( zx:fComplex; yRe:Single ): fComplex; function mul( yRe:Single; zx:fComplex ): fComplex; function mul( px, py:fPolar ): fPolar; function mul( px:fPolar; yRe:Single ): fPolar; function mul( yRe:Single; px:fPolar ): fPolar; function mulRe( zx:fComplex; yRe:Single ): fComplex; function mulRe( px:fPolar; yRe:Single ): fPolar; fComplex neg( fComplex _z ); function neg( zx:fComplex ): fComplex; fPolar neg( fPolar _p ); function neg( px:fPolar ): fPolar; float norm( fComplex _z ); function norm( zx:fComplex ): Single; float norm( fPolar _p ); function norm( px:fPolar ): Single; fComplex pow( fComplex __base, fComplex __expon); fComplex pow( float __base, fComplex __expon); fComplex pow( fComplex __base, float __expon ); function pow( zx, exponent:fComplex ): fComplex; function pow( zx:fComplex; exponent:Single ): fComplex; function pow( base:Single; exponent:fComplex ): fComplex; function pow( px:fPolar; exponent:Single ): fPolar; fComplex powReBase( float __base, fComplex __expon ); function powReBase( base:Single; exponent:fComplex ): fComplex; fComplex powReExpo( fComplex __base, float __expon ); function powReExpo( zx:fComplex; exponent:Single ): fComplex; fPolar powReExpo( fPolar __base, float __expon ); function powReExpo( px:fPolar; exponent:Single ): fPolar; fPolar principal( fPolar _p ); fPolar principal( floag __mag, float __arg ); function principal( px:fPolar ): fPolar; fComplex quartic( fComplex _z ); function quartic( zx:fComplex ): fComplex; fPolar quartic( fPolar _p ); function quartic( px:fPolar ): fPolar; float z.real(); // to be used as zre = z.real(); float real( fComplex _z ); // to be used as zre = real ( _z ); function real( zx:fComplex ): Single; float real( fPolar _p ); function real( px:fPolar ): Single; fPolar reimtop( float _re, float _im ); function reimtop( re, im:Single ): fPolar; fComplex sin( fComplex _z ); function sin( zx:fComplex ): fComplex; fComplex sinh( fComplex _z ); function sinh( zx:fComplex ): fComplex; fComplex sqrt( fComplex _z ); function sqrt( zx:fComplex ): fComplex; fPolar sqrt( fPolar _p ); function sqrt( px:fPolar ): fPolar; fComplex square( fComplex _z ); function square( zx:fComplex ): fComplex; fPolar square( fPolar _z ); function square( px:fPolar ): fPolar; function sub( zx, zy:fComplex ): fComplex; function sub( zx:fComplex; yRe:Single ): fComplex; function sub( yRe:Single; zx:fComplex ): fComplex; function subRe( zx:fComplex; yRe:Single ): fComplex; function subrRe( zx:fComplex; yRe:Single ): fComplex; fComplex tan( fComplex _z ); function tan( zx:fComplex ): fComplex; fComplex tanh( fComplex _z ); function tanh( zx:fComplex ): fComplex; Back to CMATH Table of Contents OptiVec home Copyright © 1996-2020 OptiCode - Dr. Martin Sander Software Development |