ARG(X,Y) is the counterclockwise angle (in radians) from the positive X axis to the ray from the origin through the point (X,Y). It is defined unless both X and Y are 0. Its values range from -PI to PI.

If X > 0, ARG(X,Y) = ARCTAN(Y/X). If X = 0 and Y > 0, ARG(X,Y) = PI/2. If X = 0 and Y < 0, ARG(X,Y) = -PI/2. If X < 0 and Y >= 0, ARG(X,Y) = PI + ARCTAN(Y/X). If X < 0 and Y < 0, ARG(X,Y) = -PI + ARCTAN(Y/X).

In all cases, COS(ARG(X,Y)) = X/R and SIN(ARG(X,Y)) = Y/R, where R = SQRT(X^2 + Y^2).

In terms of complex analysis, ARG(X,Y) = Im(ln(X + i Y)) (for the appropriate branch of the logarithm).

See also the ARCTAN function.

Arccos function |

Arcsin function |

Arctan function |

Mathematical formulas |

Pi (constant) |

Help index |