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

Version Path
decidim-admin-0.19.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.17.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.18.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.17.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.16.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.17.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.16.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.15.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.15.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.15.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.14.4 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.14.3 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.14.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.14.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.13.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.12.2 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.13.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.12.1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.13.0.pre1 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.12.0 app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss