UNPKG

@thewtex/vtk.js-esm

Version:

Visualization Toolkit for the Web

31 lines (26 loc) 603 B
/** * Common utilities * @module glMatrix */ // Configuration Constants var EPSILON = 0.000001; var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; var RANDOM = Math.random; var degree = Math.PI / 180; /** * Convert Degree To Radian * * @param {Number} a Angle in Degrees */ function toRadian(a) { return a * degree; } if (!Math.hypot) Math.hypot = function () { var y = 0, i = arguments.length; while (i--) { y += arguments[i] * arguments[i]; } return Math.sqrt(y); }; export { ARRAY_TYPE as A, EPSILON as E, RANDOM as R, toRadian as t };