Help Center

CArgfunction

Returns the argument of a complex number.

Numeric DatatypesfunctionAfxComplex.incdocumented

Syntax

FUNCTION CArg (BYREF z AS _complex) AS DOUBLE
Also documented as CArgument, CPhase — one description covers them all.

Description

Returns the argument of this complex number.

Examples

DIM z AS _complex = (1, 0) DIM d AS DOUBLE = CArg(z) PRINT d Output: 0

DIM z AS _complex = (0, 1) DIM d AS DOUBLE = CArg(z) PRINT d Output: 1.570796326794897

DIM z AS _complex = (0, -1) DIM d AS DOUBLE = CArg(z) PRINT d Output: -1.570796326794897

DIM z AS _complex = (-1, 0) DIM d AS DOUBLE = CArg(z) PRINT d Output: 3.141592653589793

Reference

  • Include file AfxComplex.inc
  • Defined in AfxNova/AfxComplex.inc:493
  • Documented in Numeric Datatypes/Complex Numbers Procedures.md
  • Topic: Complex Numbers Procedures