trigUnit.js 630 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.createTrigUnit = void 0;
  6. var _factory = require("../../utils/factory.js");
  7. var createTrigUnit = /* #__PURE__ */(0, _factory.factory)('trigUnit', ['typed'], function (_ref) {
  8. var typed = _ref.typed;
  9. return {
  10. Unit: typed.referToSelf(function (self) {
  11. return function (x) {
  12. if (!x.hasBase(x.constructor.BASE_UNITS.ANGLE)) {
  13. throw new TypeError('Unit in function cot is no angle');
  14. }
  15. return typed.find(self, x.valueType())(x.value);
  16. };
  17. })
  18. };
  19. });
  20. exports.createTrigUnit = createTrigUnit;