asin()
Baseline 2023Newly available
Since March 2023, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
The asin()
CSS function is a trigonometric function that returns the inverse sine of a number between -1
and 1
. The function contains a single calculation that returns the number of radians representing an
between -90deg
and 90deg
.
Syntax
css
/* Single values */
transform: rotate(asin(-0.2));
transform: rotate(asin(2 * 0.125));
/* Other values */
transform: rotate(asin(pi / 5));
transform: rotate(asin(e / 3));
Parameters
The asin(number)
function accepts only one value as its parameter.
Return value
Formal syntax
Examples
Rotate elements
The asin()
function can be used to rotate
elements as it return an
.
HTML
html
CSS
css
div.box {
width: 100px;
height: 100px;
background: linear-gradient(orange, red);
}
div.box-1 {
transform: rotate(asin(1));
}
div.box-2 {
transform: rotate(asin(0.5));
}
div.box-3 {
transform: rotate(asin(0));
}
div.box-4 {
transform: rotate(asin(-0.5));
}
div.box-5 {
transform: rotate(asin(-1));
}
Result
Specifications
Specification |
---|
CSS Values and Units Module Level 4 # trig-funcs |