Sha256: 171f32af147623f4cc40519813115669fc7cd7f85f8cdebbd54d0939869c3080
Contents?: true
Size: 398 Bytes
Versions: 31
Compression:
Stored size: 398 Bytes
Contents
// Returns the cosine of a number. // @param {Number} $x A number in rad or deg. Assuming unitless number to be in rad. // @example // cos(0.7854) // 0.70711 // cos(45deg) // 0.70711 @use "sass:math"; @function cos ($x){ $x: unitless-rad($x) % ($PI * 2); $ret: 0; @for $n from 0 to 24{ $ret: $ret + math.div(pow(-1, $n) * pow($x, 2 * $n), fact(2 * $n)); } @return $ret; }
Version data entries
31 entries across 31 versions & 1 rubygems