sass-planifolia

Vanilla Sass helper functions
git clone https://git.ce9e.org/sass-planifolia.git

commit
880da29952b8047d595d021e4ae7f0e5959b397b
parent
d6d2b699b9f432b4eb73529a844ef688b15757ac
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2016-04-23 19:48
math: fix cos/tan on angle input

Diffstat

M sass/math.scss 1 +
M test/math.js 6 ++++++

2 files changed, 7 insertions, 0 deletions


diff --git a/sass/math.scss b/sass/math.scss

@@ -198,6 +198,7 @@ $planifolia-math-steps-default: 32 !default;
  198   198 /// @param {number} $steps [32] - steps of the taylor expansion
  199   199 /// @return {number}
  200   200 @function cos($x, $steps: $planifolia-math-steps-default) {
   -1   201   $x: _planifolia-angle-to-rad($x);
  201   202   @return sin($x + pi() / 2, $steps);
  202   203 }
  203   204 

diff --git a/test/math.js b/test/math.js

@@ -103,6 +103,9 @@ describe('math', function() {
  103   103     it('cos(-2)', function() {
  104   104       shared.similar(sassaby.func('cos').calledWithArgs('-2'), Math.cos(-2));
  105   105     });
   -1   106     it('cos(270deg) == 0', function() {
   -1   107       sassaby.func('cos').calledWithArgs('270deg').equals('0');
   -1   108     });
  106   109   });
  107   110 
  108   111   describe('tan', function() {
@@ -118,6 +121,9 @@ describe('math', function() {
  118   121     it('tan(12345678.9)', function() {
  119   122       shared.similar(sassaby.func('tan').calledWithArgs('12345678.9'), Math.tan(12345678.9));
  120   123     });
   -1   124     it('tan(45deg) == tan(pi() / 4)', function() {
   -1   125       shared.similar(sassaby.func('tan').calledWithArgs('45deg'), Math.tan(Math.PI / 4));
   -1   126     });
  121   127   });
  122   128 
  123   129   describe('asin', function() {