Sha256: da9d93630569d0c25461c1feb1a7fe6a51796826558044d1781785f7a4432793
Contents?: true
Size: 917 Bytes
Versions: 31
Compression:
Stored size: 917 Bytes
Contents
// Returns the arctangent of the quotient of its arguments. // @param {Number} $y // @param {Number} $x // @example // atan2(0, 0) // 0 // atan2(0, -0.0) // 3.14159 // atan2(-0.0, 0) // 0 // atan2(-0.0, -0.0) // -3.14159 // atan2(0, 1) // 0 // atan2(0, -1) // 3.14159 @use "sass:math"; @function atan2 ($y, $x){ @if $x > 0{ @return atan(math.div($y, $x)); } @else if $x < 0{ @if $y < 0{ @return atan(math.div($y, $x)) - $PI; } @else{ @return atan(math.div($y, $x)) + $PI; } } @else{ @if $y < 0{ @return - $PI * .5; } @else if $y > 0{ @return $PI * .5; } @else{ @if math.div(1, $x) == math.div(1, 0){ @return 0; } @else{ @if math.div(1, $y) == math.div(1, 0){ @return $PI; } @else{ @return -$PI; } } } } }
Version data entries
31 entries across 31 versions & 1 rubygems