function
atan2() — CSS reference
Inverse tangent with separate y and x arguments preserves quadrant information. The inputs need compatible types and the result is an angle in the principal interval from -180deg to 180deg. Unlike atan(y / x), it distinguishes signs of both coordinates.
Formal Syntax & Structure
css syntaxcss
atan2(<calc-sum>, <calc-sum>)Working Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS math lab</title><style>body {margin:0} .sample {height:12px;background:#006050}#a {transform:rotate(atan2(3px, 3px))} #b {transform:rotate(atan2(3px, -3px))} .sample {width:60px;height:20px;margin:30px}</style><body><div class="parent"><div id="a" class="sample"></div><div id="b" class="sample"></div></div></body></html>