Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- return {
- dob: date,
- dom: start,
- weight: coef,
- getBMI: format,
- getLMS: extend,
- getPercentile: function() {
- var val = calc();
- /**
- * @param {number} t
- * @return {?}
- */
- var interpolate = function(t) {
- /** @type {number} */
- var x = 0.254829592;
- /** @type {number} */
- var y = -0.284496736;
- /** @type {number} */
- var i = 1.421413741;
- /** @type {number} */
- var c = -1.453152027;
- /** @type {number} */
- var r = 1.061405429;
- /** @type {number} */
- var width = 1 / (1 + 0.3275911 * (t = Math.abs(t)));
- return 1 - ((((r * width + c) * width + i) * width + y) * width + x) * width * Math.exp(-1 * t * t);
- };
- return parseInt(1000 * function(decimalNum) {
- /** @type {number} */
- var HAS_RESOURCE_RADIUS = 1;
- return decimalNum < 0 && (HAS_RESOURCE_RADIUS = -1), 0.5 * (1 + HAS_RESOURCE_RADIUS * interpolate(Math.abs(decimalNum) / Math.sqrt(2)));
- }(val)) / 10;
- },
- lowerSD: function() {
- var self = extend();
- return (self.M - self.M * Math.pow(1 + self.L * self.S * -2, 1 / self.L)) / 2;
- },
- upperSD: function() {
- var self = extend();
- return (self.M * Math.pow(1 + self.L * self.S * 2, 1 / self.L) - self.M) / 2;
- },
- getBalence: function(length) {
- /** @type {string} */
- var status = "Error";
- return length < 5 ? status = "Underweight" : length >= 5 && length <= 85 ? status = "Normal" : length > 85 && length <= 95 ? status = "Overweight" : length > 95 && (status = "Obese"), status;
- }
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement