Added new util function that sends tan function infinities correctly

Changed mathop to call new math util
Changed sin & cos to round correctly (to get 0)
Added testing for the new math util function
Added testing for the new mathop functions
This commit is contained in:
SillyInventor 2017-01-31 19:05:54 -05:00
parent fff63e3af2
commit 1ac89f5aa4
4 changed files with 39 additions and 6 deletions
test/unit

View file

@ -34,3 +34,11 @@ test('wrapClamp', function (t) {
t.strictEqual(math.wrapClamp(100, 0, 10), 1);
t.end();
});
test('tan', function (t) {
t.strictEqual(math.tan(90), Infinity);
t.strictEqual(math.tan(180), 0);
t.strictEqual(math.tan(-90), -Infinity);
t.strictEqual(math.tan(33), 0.6494075932);
t.end();
});