avocado/packages/math/test/math.js
2021-04-20 06:26:13 -05:00

12 lines
363 B
JavaScript

import {expect} from 'chai';
import {angleFromRad, HALF_PI, PI} from '../src/math';
it('can translate radians into degrees', () => {
expect(angleFromRad(0)).to.equal(90);
expect(angleFromRad(HALF_PI)).to.equal(0);
expect(angleFromRad(PI)).to.equal(270);
expect(angleFromRad(PI + HALF_PI)).to.equal(180);
expect(angleFromRad(2 * PI)).to.equal(90);
});