Bookmark this: tool.io/lighting/candela-to-lux-calculator/source-code
Candela to Lux Calculator Source Code
Browse the implementation files for Candela to Lux Calculator.tool.ts typescript
const parseFinite = (value: unknown): number | null => {
if (value === '' || value === null || value === undefined)
return null;
const parsed = Number(value);
return Number.isFinite(parsed) ? parsed : null;
};
export const candelaToLux = (
intensityInput: unknown,
distanceInput: unknown
) => {
const intensity = parseFinite(intensityInput);
const distance = parseFinite(distanceInput);
if (
intensity === null ||
intensity < 0 ||
distance === null ||
distance <= 0
)
return '';
return intensity / distance ** 2;
};
export const Tool: TypeTool = {
name: 'Candela to Lux Calculator',
slug: 'lighting/candela-to-lux-calculator',
tool: candelaToLux,
intro:
'Calculate illuminance from luminous intensity and distance for an ideal point source aimed perpendicular to the surface.',
i: [
{
example: '1000',
label: 'Luminous intensity',
placeholder: 'Candela (cd)',
type: 'number'
},
{
example: '2',
label: 'Distance',
placeholder: 'Meters (m)',
type: 'number'
}
],
o: [
{
example: '250',
label: 'Illuminance',
placeholder: 'Lux (lx)',
render: 'textarea',
type: 'number'
}
],
equation: 'Eᵥ = Iᵥ / r²',
alternative: [
{
title: 'Candela to Lumens Calculator',
url: '/lighting/candela-to-lumens-calculator'
},
{
title: 'Lumens to Lux Calculator',
url: '/lighting/lumens-to-lux-calculator'
},
{
title: 'Convert illuminance',
url: '/convert/illuminance'
},
{
title: 'Convert luminous intensity',
url: '/convert/luminous-intensity'
}
],
cite: [
{
title: 'Practical realization of the lux — BIPM',
url: 'https://www.bipm.org/documents/20126/41489685/SI-App2-candela.pdf'
}
]
};
export default Tool;
Description
Browse the implementation files for Candela to Lux Calculator.