Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

atan() — inverse tangent

atan() maps any finite number 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

atan(<calc-sum>)

atan() uses atan(<calc-sum>) and maps any finite number 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: atan(1) computes to 45deg, while the boundary case atan(-1) computes to -45deg. The value comes from getComputedStyle and therefore exercises the computed-value stage.

Boundary behavior: large magnitudes approach ±90 degrees, but the function cannot distinguish a vector quadrant.

Examples

const a=document.createElement('div'),b=document.createElement('div');document.body.append(a,b);a.style.rotate='atan(1)';b.style.rotate='atan(-1)';console.log('positive='+getComputedStyle(a).rotate+'; negative='+getComputedStyle(b).rotate);

Result

positive=45deg; negative=-45deg

atan() maps any finite number to a principal angle from −90 through 90 degrees.

Sources