CSS atan() Function

Definition and Usage

CSS's atan() The function returns the inverse tangent of a number between -∞ and ∞.

The inverse tangent of a number returns an angle between -90 and 90 degrees.

Some Examples:

  • atan(-1) represents -45 degrees
  • atan(0) represents 0 degrees
  • atan(1) represents 45 degrees
  • atan(-∞) represents -90 degrees
  • atan(∞) represents 90 degrees

Example

Using atan() Rotating Element:

div.a {
  transform: rotate(atan(500));
}
div.b {
  transform: rotate(atan(1));
}
div.c {
  transform: rotate(atan(0));
}
div.d {
  transform: rotate(atan(-5000));
}

Try It Yourself

CSS Syntax

atan(number)
Value Description
number Required. A number between -∞ and ∞.

Technical Details

Version: CSS4

Browser Support

The numbers in the table represent the first browser version to fully support this function.

Chrome Edge Firefox Safari Opera
111 111 108 15.4 97

Related Page

Reference:CSS acos() Function

Reference:CSS asin() function

Reference:CSS atan2() function

Reference:CSS calc() Function

Reference:CSS cos() Function

Reference:CSS exp() Function

Reference:CSS hypot() Function

Reference:CSS log() Function

Reference:CSS mod() Function

Reference:CSS pow() Function

Reference:CSS sin() function

Reference:CSS sqrt() function

Reference:CSS tan() function