Sha256: 2d182ec68abbcf3d3cb58fd482fbf08a6c4230bc4de7086652ca2620a669e4d8
Contents?: true
Size: 620 Bytes
Versions: 31
Compression:
Stored size: 620 Bytes
Contents
// Returns the arctangent of a number. // @param {Number} $x // @example // atan(0.1) // 0.09967 // atan(-1) // -0.7854 @use "sass:math"; @function atan ($x){ $i: 24; $sgn: 0; $a: 0; @if $x > 1{ $sgn: 1; $x: math.div(1, $x); } @else if $x < -1{ $sgn: -1; $x: math.div(1, $x); } @while $i > 0{ $a: math.div($i * $i * $x * $x, 2 * $i + 1 + $a); $i: $i - 1; } @if $sgn > 0{ @return $PI * .5 - math.div($x, 1 + $a); } @else if $sgn < 0{ @return -$PI * .5 - math.div($x, 1 + $a); } @else{ @return math.div($x, 1 + $a); } }
Version data entries
31 entries across 31 versions & 1 rubygems