@brewlab/calc
Version:
Library with methods for calculations used in brewing.
19 lines (18 loc) • 606 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Converts a pre-fermented gravity measurement into brix.
* Note: this calculator will only work for unfermented
* wart.
* @param {number} og The original gravity measurement (e.g. 1.050)
* @returns {number} the brix value that represents the provided
* original gravity.
*/
function originalGravityToBrix(og) {
// Og of 1 or less means the brix is 0
if (og <= 1) {
return 0;
}
return (((182.4601 * og - 775.6821) * og + 1262.7794) * og - 669.5622);
}
exports.default = originalGravityToBrix;