Advertisement
Jayss8

wtf

Apr 17th, 2021
1,365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. return {
  2.     dob: date,
  3.     dom: start,
  4.     weight: coef,
  5.     getBMI: format,
  6.     getLMS: extend,
  7.     getPercentile: function() {
  8.         var val = calc();
  9.         /**
  10.          * @param {number} t
  11.          * @return {?}
  12.          */
  13.         var interpolate = function(t) {
  14.             /** @type {number} */
  15.             var x = 0.254829592;
  16.             /** @type {number} */
  17.             var y = -0.284496736;
  18.             /** @type {number} */
  19.             var i = 1.421413741;
  20.             /** @type {number} */
  21.             var c = -1.453152027;
  22.             /** @type {number} */
  23.             var r = 1.061405429;
  24.             /** @type {number} */
  25.             var width = 1 / (1 + 0.3275911 * (t = Math.abs(t)));
  26.             return 1 - ((((r * width + c) * width + i) * width + y) * width + x) * width * Math.exp(-1 * t * t);
  27.         };
  28.         return parseInt(1000 * function(decimalNum) {
  29.             /** @type {number} */
  30.             var HAS_RESOURCE_RADIUS = 1;
  31.             return decimalNum < 0 && (HAS_RESOURCE_RADIUS = -1), 0.5 * (1 + HAS_RESOURCE_RADIUS * interpolate(Math.abs(decimalNum) / Math.sqrt(2)));
  32.         }(val)) / 10;
  33.     },
  34.     lowerSD: function() {
  35.         var self = extend();
  36.         return (self.M - self.M * Math.pow(1 + self.L * self.S * -2, 1 / self.L)) / 2;
  37.     },
  38.     upperSD: function() {
  39.         var self = extend();
  40.         return (self.M * Math.pow(1 + self.L * self.S * 2, 1 / self.L) - self.M) / 2;
  41.     },
  42.     getBalence: function(length) {
  43.         /** @type {string} */
  44.         var status = "Error";
  45.         return length < 5 ? status = "Underweight" : length >= 5 && length <= 85 ? status = "Normal" : length > 85 && length <= 95 ? status = "Overweight" : length > 95 && (status = "Obese"), status;
  46.     }
  47. };
  48. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement