asin() CSS Function
The asin() function returns the arcsine of a number between -1 and 1, as an angle.
Description
The asin() CSS function calculates the arcsine (inverse sine) of a number. It answers the question "which angle has this sine?". The argument is a <number> between -1 and 1, and the result is an <angle> between -90deg and 90deg. For example, asin(0.5) is 30deg and asin(1) is 90deg. Values outside the range -1 to 1 return NaN.
Because the result is an angle, it can be used directly in rotations. A typical use is turning a ratio into a tilt, for example rotating a needle or a progress indicator according to a value stored in a custom property.
The asin() function is one of the CSS trigonometric functions, together with sin(), cos(), tan(), asin(), acos(), atan() and atan2(). Like calc(), it can be used anywhere a value of the matching type is accepted, and its arguments can contain full calculations, custom properties and the constants pi and e.
/* Rotate by the angle whose sine is 0.5 (30deg) */
.needle {
rotate: asin(0.5);
}
/* Tilt based on a ratio between -1 and 1 */
.gauge {
rotate: asin(var(--ratio));
}
Interactive Demo
Syntax
asin() = asin( <calc-sum> )
Values
- <calc-sum>A calculation resolving to a <number> between -1 and 1. The function returns an <angle> between -90deg and 90deg.
Example
Browser Support
The following information will show you the current browser support for the CSS asin() function. Hover over a browser icon to see the version that first introduced support for this CSS function.
Desktop





Tablets & Mobile





