UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

132 lines (131 loc) 3.81 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { __extends } from "tslib"; import { Base, markType } from "./type"; import { isNaN_, isInfinity } from "./number"; /** * @hidden */ var MathUtil = /** @class */ /*@__PURE__*/ (function (_super) { __extends(MathUtil, _super); function MathUtil() { return _super !== null && _super.apply(this, arguments) || this; } MathUtil.c = function (a) { return Math.log(a + Math.sqrt(a * a + 1)); }; MathUtil.a = function (a, b) { if (Math.abs(a - b) < 1E-05) { return true; } return false; }; MathUtil.t = function (number_) { return number_.toString(); }; MathUtil.h = function (a, b) { return Math.sqrt(a * a + b * b); }; MathUtil.q = function (a) { return a * a; }; MathUtil.b = function (a) { return !isNaN_(a) && !isInfinity(a); }; MathUtil.e = function (a, b, c) { return Math.min(c, Math.max(b, a)); }; MathUtil.p = function (a) { return Math.PI * a / 180; }; MathUtil.g = function (a) { return 180 * a / Math.PI; }; MathUtil.m = function (a, b, c) { return Math.min(a, Math.min(b, c)); }; MathUtil.j = function (a, b, c) { return Math.max(a, Math.max(b, c)); }; MathUtil.l = function () { var a = []; for (var _i = 0; _i < arguments.length; _i++) { a[_i] = arguments[_i]; } var b = a[0]; for (var c = 1; c < a.length; ++c) { b = Math.min(b, a[c]); } return b; }; MathUtil.n = function (a) { var b = a[0]; for (var c = 1; c < a.length; ++c) { b = Math.min(b, a[c]); } return b; }; MathUtil.i = function () { var a = []; for (var _i = 0; _i < arguments.length; _i++) { a[_i] = arguments[_i]; } var b = a[0]; for (var c = 1; c < a.length; ++c) { b = Math.max(b, a[c]); } return b; }; MathUtil.k = function (a) { var b = a[0]; for (var c = 1; c < a.length; ++c) { b = Math.max(b, a[c]); } return b; }; MathUtil.s = function (a) { if (a.length == 0) { return 0; } var b = 0; for (var d = 0; d < a.length; d++) { var c = a[d]; if (isNaN_(c)) { continue; } if (isInfinity(c)) { continue; } b += c; } return b; }; MathUtil.d = function (a) { if (a.length == 0) { return 0; } var b = 0; var c = 0; for (var e = 0; e < a.length; e++) { var d = a[e]; if (isNaN_(d)) { continue; } if (isInfinity(d)) { continue; } b += d; c++; } return b / c; }; MathUtil.$t = markType(MathUtil, 'MathUtil'); MathUtil.o = (1 + Math.sqrt(5)) / 2; MathUtil.r = Math.sqrt(2); return MathUtil; }(Base)); export { MathUtil };