Sha256: 01b5ba8254c2cb050ebf40c274044ad87afc771e8a7473c178dcfbcce66af549
Contents?: true
Size: 612 Bytes
Versions: 106
Compression:
Stored size: 612 Bytes
Contents
// Returns the arctangent of a number. // @param {Number} $x // @example // atan(0.1) // 0.09967 // atan(-1) // -0.7854 @function atan ($x) { $i: 24; $sgn: 0; $a: 0; @if $x > 1 { $sgn: 1; $x: 1 / $x; } @else if $x < -1 { $sgn: -1; $x: 1 / $x; } @while $i > 0 { $a: ($i * $i * $x * $x) / (2 * $i + 1 + $a); $i: $i - 1; } @if $sgn > 0 { @return $PI / 2 - $x / (1 + $a); } @else if $sgn < 0 { @return -$PI / 2 - $x / (1 + $a); } @else { @return $x / (1 + $a); } }
Version data entries
106 entries across 106 versions & 3 rubygems