WorksheetFunction.Atan2 (Excel)

Returns the arctangent, or inverse tangent, of the specified x- and y-coordinates. The arctangent is the angle from the x-axis to a line containing the origin (0, 0) and a point with coordinates (x_num, y_num). The angle is given in radians between -pi and pi, excluding -pi.

A positive result represents a counterclockwise angle from the x-axis; a negative result represents a clockwise angle. The following conditions apply:

Atan2 (Arg1, Arg2)

Dim dblArg1 As Double: dblArg1 = 
Dim dblArg2 As Double: dblArg2 = 
Dim dblAtan2 As Double
dblAtan2 = WorksheetFunction.Atan2(Arg1:=dblArg1, Arg2:=dblArg2)


Arg1, Arg2

Arg1 (Double) - The x-coordinate of the point.

Arg2 (Double) - The y-coordinate of the point.