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
body {
font-family: Arial, sans-serif;
margin: 20px;
background-color: #f8f9fa;
}
.calculator-box {
max-width: 450px;
margin: auto;
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0,0,0,0.2);
}
h2 {
text-align: center;
}
label {
display: inline-block;
width: 140px;
font-weight: bold;
}
input {
padding: 5px;
width: 120px;
margin-bottom: 10px;
}
button {
width: 100%;
padding: 10px;
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
font-size: 16px;
}
button:hover {
background-color: #0056b3;
}
function starToDelta() {
let Ra = parseFloat(document.getElementById(“Ra”).value);
let Rb = parseFloat(document.getElementById(“Rb”).value);
let Rc = parseFloat(document.getElementById(“Rc”).value);
if (isNaN(Ra) || isNaN(Rb) || isNaN(Rc)) {
alert(“Please enter all Star resistor values.”);
return;
}
let sum = Ra*Rb + Rb*Rc + Rc*Ra;
let R1 = sum / Ra;
let R2 = sum / Rb;
let R3 = sum / Rc;
document.getElementById(“deltaOutput”).innerHTML =
`R1 = ${R1.toFixed(2)} Ω, R2 = ${R2.toFixed(2)} Ω, R3 = ${R3.toFixed(2)} Ω`;
}
function deltaToStar() {
let R1 = parseFloat(document.getElementById(“R1”).value);
let R2 = parseFloat(document.getElementById(“R2”).value);
let R3 = parseFloat(document.getElementById(“R3”).value);
if (isNaN(R1) || isNaN(R2) || isNaN(R3)) {
alert(“Please enter all Delta resistor values.”);
return;
}
let sum = R1 + R2 + R3;
let Ra = (R2 * R3) / sum;
let Rb = (R1 * R3) / sum;
let Rc = (R1 * R2) / sum;
document.getElementById(“starOutput”).innerHTML =
`Ra = ${Ra.toFixed(2)} Ω, Rb = ${Rb.toFixed(2)} Ω, Rc = ${Rc.toFixed(2)} Ω`;
}
(adsbygoogle = window.adsbygoogle || []).push({});