fcplxdcplxecplx
FunctionInitialization of cartesian-complex numbers
Syntax C/C++#include <VecLib.h>
fComplex fcplx( float ReVal, float ImVal );

    (similarly dcplx,   ecplx)
Pascal/Delphiuses VecLib;
procedure fcplx( var zy:fComplex; xRe, xIm: Single );

    (similarly dcplx,   ecplx)
DescriptionThese functions allow to generate complex numbers of the three cartesian data types fComplex, dComplex, and eComplex. CMATH offers overloaded versions of these functions for C++. See CMATH.HTM, chapter 2.1 for details.
In C/C++, fcplx should be used whenever temporary complex variables are needed as arguments for functions. In this case, fcplx replaces the less elegant direct assignment of the real and imaginary parts, e.g.:
  z.Re = 3.0; z.Im = 4.0;
  VCF_equC( X, size, z ); /* less convenient */
  VCF_equC( Y, size, fcplx( 3.0, 4.0 )); /* easier */

In Pascal/Delphi, writing
  fcplx( z, 3.0, 4.0 );
is just equivalent to
  z.Re = 3.0; z.Im = 4.0;
Error handlingnone
Return valuethe generated complex number (C/C++)
See alsofpolr

VectorLib Table of Contents  OptiVec home