math.atan($number) returns the arctangent of $number in deg. $number must be unitless (any real slope ratio). Load it with @use "sass:math" on Dart Sass 1.25+.
Official sample.
math.atan(10) → 84.2894068625deg.
Inverse of tangent.
Think rise/run: math.atan(1) is 45deg. Pair with math.tan for round-trips. Need quadrant-aware points? Use math.atan2.
Unitless input only.
Do not pass px or deg into math.atan. Divide compatible lengths first (for example with math.div) to get a unitless slope.
Syntax
Syntax
SCSS
@use "sass:math";
math.atan($number); //=> angle in deg
math.atan(10); // 84.2894068625deg
math.atan(1); // 45deg
math.atan(0); // 0deg
math.atan(-1); // -45deg
// Slope from lengths (must cancel units first)
math.atan(math.div(10px, 10px)); // 45deg
// Module API — prefer math.atan after @use "sass:math"
Pattern: build a unitless slope → math.atan for a CSS angle → use math.atan2 when x and y are separate and the quadrant matters.
Reference
Slope and Range
Unlike asin/acos, atan accepts any real unitless number:
Input
Result
math.atan(0)
0deg
math.atan(1)
45deg
math.atan(-1)
-45deg
math.atan(10)
84.2894068625deg
Very large positive
Approaches 90deg
Very large negative
Approaches -90deg
Input with units
Error — must be unitless
atan vs atan2.
Official docs note that math.atan(math.div(1, -1)) is -45deg, while math.atan2(1, -1) is 135deg because atan2 keeps the point’s quadrant.
Returns arctangent in deg from a unitless slope ratio.
Any real ratio works — not limited to -1…1.
Use atan2 for quadrants when x and y are separate.
Dart Sass 1.25+ via @use "sass:math".
One line: when a unitless slope must become a CSS angle, call math.atan($number).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:math"
2. Pass a unitless slope (cancel length units first)
3. Expect a deg angle (~ -90deg…90deg)
4. Use math.atan2 when quadrant matters
5. Use math.tan for the forward transform
Frequently Asked Questions
math.atan($number) returns the arctangent of a unitless number in degrees. Example: math.atan(10) is about 84.2894068625deg.
Add @use "sass:math"; then call math.atan($number). Requires Dart Sass 1.25+.
Any unitless number (a slope ratio like rise/run). Unlike asin/acos, it is not limited to -1…1. Lengths like px are not allowed.
An angle in deg, typically between about -90deg and 90deg. Large positive inputs approach 90deg; large negative inputs approach -90deg.
They are inverse ideas: math.tan(math.atan(1)) recovers 1, and math.atan(math.tan(45deg)) recovers 45deg (within floating-point precision).
Use math.atan2($y, $x) when you have separate vertical and horizontal components and need the correct quadrant. Plain math.atan(math.div($y, $x)) loses quadrant information.