CFromPolarCoordinatesfunction
Returns the square root of the complex number z. The branch cut is the negative real axis. The result always lies in the right half of the complex plane. Example: DIM z AS _complex = (2, 3) z = CSqr(z) PRINT CStr(z) Output: 1.67414922803554 +0.895977476129838 * i Compute the square root of -1: DIM z AS _complex = (-1) z = CSqr(z) PRINT CStr(z) Output: 0 +1.0 * i // Make a complex number from polar coordinates
Syntax
PRIVATE FUNCTION CFromPolarCoordinates (BYVAL magnitude AS DOUBLE, BYVAL phase AS DOUBLE) AS _complex
Parameters
| Name | Description | |
|---|---|---|
NET | 4.7 code: public static Complex FromPolarCoordinates(Double magnitude, Double phase) /* Factory method to take polar inputs and create a Complex object */ { return new Complex((magnitude * Math.Cos(phase)), (magnitude * Math.Sin(phase))); } |
Description
Returns the square root of the complex number z. The branch cut is the negative real axis. The result always lies in the right half of the complex plane. Example: DIM z AS _complex = (2, 3) z = CSqr(z) PRINT CStr(z) Output: 1.67414922803554 +0.895977476129838 * i Compute the square root of -1: DIM z AS _complex = (-1) z = CSqr(z) PRINT CStr(z) Output: 0 +1.0 * i // Make a complex number from polar coordinates
Reference
- Include file
AfxComplex.inc - Defined in AfxNova/AfxComplex.inc:669