CSS atan() Function
Example
Use atan() to rotate elements:
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 »
Definition and Usage
The CSS atan()
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(-infinity) represents -90 degrees
- atan(infinity) represents 90 degrees
Version: | CSS4 |
---|
Browser Support
The numbers in the table specify the first browser version that fully supports the function.
Function | |||||
---|---|---|---|---|---|
atan() | 111 | 111 | 108 | 15.4 | 97 |
CSS Syntax
atan(number)
Value | Description |
---|---|
number | Required. A number between -∞ and ∞ |
Related Pages
CSS reference: CSS acos() function.
CSS reference: CSS asin() function.
CSS reference: CSS atan2() function.
CSS reference: CSS calc() function.
CSS reference: CSS cos() function.
CSS reference: CSS exp() function.
CSS reference: CSS hypot() function.
CSS reference: CSS log() function.
CSS reference: CSS mod() function.
CSS reference: CSS pow() function.