<atan2>

A more advanced arctangent function that takes two numbers (y and x) to calculate the angle from the origin. It correctly handles all four quadrants, making it the most reliable tool for coordinate-based math in CSS.

Quick example

.pointer {
  /* Calculates the angle between two points */
  transform: rotate(calc(atan2(var(--y), var(--x))));
}

<atan2> Browser Support

Widely available Since 2023 92% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2023.

Safe to use without fallbacks.

111+
108+
15.4+
111+
ESC