diff --git a/math.scss b/math.scss index 5dd2a43..9092e80 100644 --- a/math.scss +++ b/math.scss @@ -62,16 +62,26 @@ $ret: 0; $n: 1; $dx: .001; - + @while $n <= $x { $ret: $ret + $dx / $n; - + $n: $n + $dx; } - + @return $ret; } -@function sqrt($x) { +@function sqrt($x) { @return exp(0.5 * ln($x)); } + +@function atan ($x) { + $ret: 0; + + @for $n from 0 to 25 { + $ret: $ret + power(-1, $n) * power($x, 2 * $n + 1) / (2 * $n + 1); + } + + @return $ret; +} diff --git a/test.html b/test.html index ed586aa..59465bf 100644 --- a/test.html +++ b/test.html @@ -11,6 +11,7 @@