Logo

IMARGUMENT

Updated 2023-11-08 19:47:39.910000

Syntax

SELECT [westclintech].[wct].[IMARGUMENT] (
   <@inumber, nvarchar(4000),>)

Description

Use the scalar function IMARGUMENT function to return theta, an angle expressed in radians.

Arguments

@inumber

is the value at which to evaluate the function. @inumber is an expression of type varchar or of a type that can be implicitly converted to varchar and must be in the format x + yi or x + yj, where x is a real number that can converted to float and yi (or yj) is an imaginary number, where the y part can be converted to float.

Return Type

float

Remarks

Use COMPLEX to convert real and imaginary coefficients into a complex number.

IMARGUMENT(@inumber) = atan(imaginary(@inumber) / imreal(@inumber))

Examples

select wct.IMARGUMENT('7+24i');

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1.28700221758657"}]}
select atan(wct.IMAGINARY('7+24i') / wct.IMREAL('7+24i'));

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"1.28700221758657"}]}