# arg() Function & Examples

Use the arg() complex function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## arg

#### arg(x)

Try it yourself:

```calculio
arg(2 + 2i)
atan2(3, 2)
arg(2 + 3i)
```

[re](https://calcul.io/function/re/index.md)

[im](https://calcul.io/function/im/index.md)

[conj](https://calcul.io/function/conj/index.md)

[abs](https://calcul.io/function/abs/index.md)

---

## arg(): The Direction of a Complex Number

**arg()** returns the argument, or angular direction, of a complex number. A complex value can be described by its horizontal real component and vertical imaginary component; arg tells you the angle of that point from the positive real axis. This polar representation is central to signal processing, phasors, and rotation.

## Interpreting the result

The result is an angle in radians on a principal branch, commonly between −π and π. For example, arg(1) is 0, while arg(i) is π/2. The zero complex number has no defined direction, so do not expect a meaningful argument for it.

To inspect a complex number, use [re()](https://calcul.io/function/re/index.md) and [im()](https://calcul.io/function/im/index.md). Its magnitude comes from [abs()](https://calcul.io/function/abs/index.md). Together, magnitude and argument form polar coordinates: z = abs(z) × (cos(arg(z)) + i sin(arg(z))).

## Quadrants and phase

arg is effectively a complex-aware angle calculation and correctly handles quadrants. When you start with separate real and imaginary components, [atan2()](https://calcul.io/function/atan2/index.md) expresses the same directional idea. Avoid using plain atan(im/re) because division by zero and quadrant ambiguity can change the answer.

Arguments can jump by 2π at the principal-branch boundary. In phase measurements, that jump is normal; use phase unwrapping in downstream analysis when a continuous angle sequence is needed. Check reconstructions with [cos()](https://calcul.io/function/cos/index.md) and [sin()](https://calcul.io/function/sin/index.md).

[All functions](https://calcul.io/functions/index.md)
