Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Everything about electronics
Everything about electronics
.calc-wrapper {
max-width: 800px;
margin: 40px auto;
padding: 20px;
border: 2px solid #ccc;
border-radius: 16px;
background-color: #fefefe;
font-family: Arial, sans-serif;
text-align: center;
}
.calc-wrapper h2 {
font-size: 24px;
}
.calc-wrapper p.caption {
color: #555;
font-size: 14px;
margin-bottom: 25px;
}
.calc-block {
border: 1px solid #aaa;
padding: 15px;
border-radius: 12px;
background-color: #f8f8f8;
margin-bottom: 25px;
}
.calc-block h3 {
margin-top: 0;
font-size: 18px;
color: #333;
}
.calc-block label {
display: inline-block;
margin: 10px;
}
.calc-block input, .calc-block select {
padding: 6px;
width: 120px;
margin: 5px;
}
.calc-block button {
padding: 8px 16px;
margin: 10px 5px 0;
border: none;
border-radius: 6px;
cursor: pointer;
}
.calc-block .calculate-btn {
background-color: #007bff;
color: #fff;
}
.calc-block .clear-btn {
background-color: #ccc;
color: #000;
}
.result {
margin-top: 10px;
font-weight: bold;
}
Calculate capacitive reactance, inductive reactance, and impedance from frequency, capacitance, and inductance values.
Hz
kHz
MHz
pF
nF
μF
mF
F
Hz
kHz
MHz
μH
mH
H
Hz
kHz
MHz
pF
nF
μF
mF
F
μH
mH
H
function autoUnit(value) {
const absVal = Math.abs(value);
if (absVal >= 1e6) return (value / 1e6).toFixed(3) + ” MΩ”;
if (absVal >= 1e3) return (value / 1e3).toFixed(3) + ” kΩ”;
if (absVal < 1e-3) return (value * 1e6).toFixed(3) + " μΩ";
if (absVal 0 && c > 0) {
const xc = 1 / (2 * Math.PI * f * c);
document.getElementById(‘xc_result’).innerText = “Xc = ” + autoUnit(xc);
}
}
function calculateXl() {
const f = parseFloat(document.getElementById(‘f_l’).value) * parseFloat(document.getElementById(‘f_l_unit’).value);
const l = parseFloat(document.getElementById(‘l_l’).value) * parseFloat(document.getElementById(‘l_l_unit’).value);
if (f > 0 && l > 0) {
const xl = 2 * Math.PI * f * l;
document.getElementById(‘xl_result’).innerText = “Xl = ” + autoUnit(xl);
}
}
function calculateImpedance() {
const f = parseFloat(document.getElementById(‘f_z’).value) * parseFloat(document.getElementById(‘f_z_unit’).value);
const c = parseFloat(document.getElementById(‘c_z’).value) * parseFloat(document.getElementById(‘c_z_unit’).value);
const l = parseFloat(document.getElementById(‘l_z’).value) * parseFloat(document.getElementById(‘l_z_unit’).value);
if (f > 0 && c > 0 && l > 0) {
const xc = 1 / (2 * Math.PI * f * c);
const xl = 2 * Math.PI * f * l;
const z = Math.abs(xl – xc);
document.getElementById(‘z_result’).innerText = “Z = ” + autoUnit(z);
}
}
// Clear functions
function clearXc() {
document.getElementById(‘f_c’).value = ”;
document.getElementById(‘c_c’).value = ”;
document.getElementById(‘xc_result’).innerText = ”;
}
function clearXl() {
document.getElementById(‘f_l’).value = ”;
document.getElementById(‘l_l’).value = ”;
document.getElementById(‘xl_result’).innerText = ”;
}
function clearZ() {
document.getElementById(‘f_z’).value = ”;
document.getElementById(‘c_z’).value = ”;
document.getElementById(‘l_z’).value = ”;
document.getElementById(‘z_result’).innerText = ”;
}
(adsbygoogle = window.adsbygoogle || []).push({});