Bookmark this: tool.io/body-roundness-index/source-code
Body Roundness Index Calculator Source Code
Browse the implementation files for Body Roundness Index Calculator.tool.ts typescript
import { calculateBodyRoundnessIndex } from '@tool.io/tools/body-roundness-index';
export const bodyRoundnessIndex = (
waist: unknown,
height: unknown
): string => {
if (waist === '' || height === '') return '';
const result = calculateBodyRoundnessIndex({
heightCm: Number(height),
waistCm: Number(waist)
});
return result.ok
? result.output.bodyRoundnessIndex.toPrecision(4)
: '';
};
// The tool definition.
export const Tool: TypeTool = {
name: 'Body Roundness Index Calculator',
slug: 'body-roundness-index',
intro: 'Calculate your body roundness index.',
tool: bodyRoundnessIndex,
i: [
{
example: '70',
label: 'Waist circumference',
placeholder: 'Waist circumference in cm',
type: 'number'
},
{
example: '180',
label: 'Height',
placeholder: 'Height in cm',
type: 'number'
}
],
o: [
{
example: '1.51',
label: 'BRI',
placeholder: 'Body roundness index',
render: 'textarea',
type: 'number'
}
],
equation:
'$$\\operatorname{BRI}=364.2-365.5\\sqrt{1-\\left(\\frac{W}{\\pi H}\\right)^2}$$',
alternative: [
{
title: 'Waist to height calculator',
url: '/waist-to-height'
},
{
title: 'Body mass index calculator',
url: '/body-mass-index'
}
],
cite: [
{
title: 'Body roundness index - Wikipedia',
url: 'https://en.wikipedia.org/wiki/Body_roundness_index'
}
]
};
export default Tool;
Description
Browse the implementation files for Body Roundness Index Calculator.