DEFINITION MODULE CmplxMath;

  (*------------------------------------------------------------------------*)
  (* Einige Routinen fuer grundlegende komplexe Arithmetik.                 *)
  (* Some routinen for basic complex arithmetic.                            *)
  (*------------------------------------------------------------------------*)
  (* Implementation : Michael Riedl                                         *)
  (* Licence        : GNU Lesser General Public License (LGPL)              *)
  (*------------------------------------------------------------------------*)

  (* $Id: CmplxMath.def,v 1.1 2017/09/27 08:14:07 mriedl Exp mriedl $ *)

PROCEDURE CABS(ar,ai : LONGREAL) : LONGREAL;

          (*----------------------------------------------------------------*)
          (* Absolute value of complex value (ar,ai) = sqrt(ar**2 + ai**2)  *)
          (*----------------------------------------------------------------*)

PROCEDURE CDIV(    ar,ai : LONGREAL;
                   br,bi : LONGREAL;
               VAR cr,ci : LONGREAL);
         
          (*----------------------------------------------------------------*)
          (* Complex divide C = A / B                                       *)
          (*----------------------------------------------------------------*)

PROCEDURE CMUL(    Xr,Xi : LONGREAL;
                   Yr,Yi : LONGREAL;
               VAR Zr,Zi : LONGREAL);

          (*----------------------------------------------------------------*)
          (* Complex multiplication Z = X * Y                               *)
          (*----------------------------------------------------------------*)

PROCEDURE CMULconj(    Xr,Xi : LONGREAL;
                       Yr,Yi : LONGREAL;
                   VAR Zr,Zi : LONGREAL);

          (*----------------------------------------------------------------*)
          (* Complex multiplication Z = X * conj(Y)                         *)
          (*----------------------------------------------------------------*)

END CmplxMath.
