Function Math Trig Complex Class

ARG

"Argument" Returns the polar angle of a rectangular coordinate pair represented by a complex number.

Signature (Visual Basic / VBA)

Public Function ARG( _
    ByVal vX As Variant _
    ) As Variant

Code Examples

    Arg("1|1") = 0.785398163397448
    Arg("2|2") = 0.785398163397448
    Arg("2|3") = 0.982793723247329
    Arg("2|4") = 1.10714871779409
    Arg("-2|-2") = -2.46740110027234
    Arg("-2|-4") = -3.47821027825327
    Arg("2|0") = 0
    IsNull(Arg("0|2")) = True
    RealPart >= 0: ATan(RealPart / ImagPart)
    RealPart <  0: ATan(RealPart / ImagPart) * Pi * Sign(ImagPart)

Parameters

Parameter Description
vX A complex number representing the rectangular coordinates whose argument is returned. The real part represents the X-coordinate and the imaginary part represents the Y-coordinate. Function returns Null if vX is Null or cannot be fixed up to a real or complex number (as defined by the ComplexStringToReals function). Complex numbers are represented within strings as "R|I" where R is the real part and I is the imaginary part.