diff --git a/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/assets/image.png b/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/assets/image.png new file mode 100644 index 000000000..8f9597271 Binary files /dev/null and b/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/assets/image.png differ diff --git a/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/index.html b/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/index.html new file mode 100644 index 000000000..807c5903b --- /dev/null +++ b/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/index.html @@ -0,0 +1,31 @@ + + +
+ + +Calculate the linewidth and bandwidth of a laser.
+ +Please enter valid positive numbers for frequency and quality factor.
`; + return; + } + + // Linewidth formula: Linewidth = Frequency / Quality Factor + const linewidth = frequency / qualityFactor; + + // Bandwidth is equivalent to linewidth in this context + const bandwidth = linewidth; + + resultDiv.innerHTML = ` +Linewidth: ${linewidth.toFixed(2)} Hz
+Bandwidth: ${bandwidth.toFixed(2)} Hz
+ `; + }); + \ No newline at end of file diff --git a/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/style.css b/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/style.css new file mode 100644 index 000000000..b565fe750 --- /dev/null +++ b/Calculators/Laser-Linewidth-And-Bandwidth-Calculator/style.css @@ -0,0 +1,72 @@ +body { + font-family: Arial, sans-serif; + background: linear-gradient(to right, #4caf50, #8bc34a); + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + color: #fff; + } + + .calculator { + background: #fff; + padding: 20px 30px; + border-radius: 10px; + text-align: center; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3); + width: 400px; + } + + h1 { + font-size: 22px; + color: #333; + } + + p { + color: #555; + font-size: 14px; + margin-bottom: 20px; + } + + .input-group { + margin-bottom: 15px; + } + + label { + display: block; + font-size: 14px; + color: #333; + margin-bottom: 5px; + } + + input { + width: 100%; + padding: 8px; + font-size: 14px; + border: 1px solid #ccc; + border-radius: 5px; + } + + button { + background: #4caf50; + color: #fff; + padding: 10px 15px; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 14px; + transition: background 0.3s; + } + + button:hover { + background: #388e3c; + } + + .result { + margin-top: 20px; + font-size: 16px; + color: #333; + } + \ No newline at end of file