Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

asin() — inverse sine

asin() maps a sine in the domain −1 through 1 to a principal angle from −90 through 90 degrees.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

asin(<calc-sum>)

asin() uses asin(<calc-sum>) and maps a sine in the domain −1 through 1 to a principal angle from −90 through 90 degrees. The result keeps the type required by the property grammar, so the function participates in value computation rather than text substitution.

The example sets a real CSS property: asin(1) computes to 90deg, while the boundary case asin(2) computes to 0deg. The value comes from getComputedStyle and therefore exercises the computed-value stage.

Boundary behavior: an out-of-domain value produces NaN, which CSS censors to zero when it escapes a top-level calculation.

Examples

const a=document.createElement('div'),b=document.createElement('div');document.body.append(a,b);a.style.rotate='asin(1)';b.style.rotate='asin(2)';console.log('valid='+getComputedStyle(a).rotate+'; invalid='+getComputedStyle(b).rotate);

Result

valid=90deg; invalid=0deg

asin() maps a sine in the domain −1 through 1 to a principal angle from −90 through 90 degrees.

Sources