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

Version Path
decidim-admin-0.27.9 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.8 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.7 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.6 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.26.10 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.26.9 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.5 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.26.8 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.4 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.3 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.26.7 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.26.5 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.2 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.1 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.26.4 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.0 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.26.3 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.0.rc2 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.27.0.rc1 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss
decidim-admin-0.26.2 app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss