This media is not supported in your browser
VIEW IN TELEGRAM
#Film ααΆαααα α αααΈα ααΆαα½αα
αααΆαααααα»ααααααααΊααΆαααααα α αΎαα
αΆαααΆα
ααα αααΆαααΈαααααΌα α¬ααααΌααααααααααααΆαααα ααααααΌαααΆαααα αααααΆαααα αααααααααα»ααααααα·ααΈ Photoshop ααΆαααααΆα αααααΆαα
β€1
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Coil Length Calculator</title>
<link rel="stylesheet" href="styles.css"> <!-- Link to the CSS file -->
<style>
/* Add the CSS styles directly here for inline use */
/* Container styling */
.calculator-container {
width: 300px;
margin: 0 auto;
padding: 20px;
background-color: #f8f9fa;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
font-family: Arial, sans-serif;
}
/* Form title */
.calculator-container h2 {
text-align: center;
color: #333;
font-size: 18px;
margin-bottom: 20px;
}
/* Label styling */
.calculator-container label {
display: block;
font-size: 14px;
margin-bottom: 5px;
color: #333;
}
/* Input field styling */
.calculator-container input[type="text"] {
width: 100%;
padding: 8px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-size: 14px;
}
/* Button styling */
.calculator-container button {
width: 100%;
padding: 10px;
background-color: #1add00;
border: none;
border-radius: 4px;
color: white;
font-size: 16px;
cursor: pointer;
}
.calculator-container button:hover {
background-color: #ffb400;
}
/* For responsive design (mobile) */
@media screen and (max-width: 400px) {
.calculator-container {
width: 90%;
}
}
</style>
</head>
<body>
<div class="calculator-container">
<h2>Calculate Coil Length</h2>
<form id="coilLengthForm">
<label for="innerDiameter">Inner Diameter (mm):</label>
<input type="text" id="innerDiameter" name="innerDiameter">
<label for="outerDiameter">Outer Diameter (mm):</label>
<input type="text" id="outerDiameter" name="outerDiameter">
<label for="thickness">Thickness (mm):</label>
<input type="text" id="thickness" name="thickness">
<button type="button" onclick="calculateCoilLength()">Calculate Length</button>
<h3 id="result" style="margin-top: 20px;"></h3>
</form>
</div>
<script>
function calculateCoilLength() {
const innerDiameter = parseFloat(document.getElementById('innerDiameter').value);
const outerDiameter = parseFloat(document.getElementById('outerDiameter').value);
const thickness = parseFloat(document.getElementById('thickness').value);
if (isNaN(innerDiameter) || isNaN(outerDiameter) || isNaN(thickness)) {
document.getElementById('result').innerHTML = "Please enter valid numbers.";
return;
}
// Coil Length in millimeters
const coilLengthMM = (Math.PI * (Math.pow(outerDiameter, 2) - Math.pow(innerDiameter, 2))) / (4 * thickness);
// Convert to meters (since 1000 mm = 1 m)
const coilLengthMeters = coilLengthMM / 1000;
document.getElementById('result').innerHTML = `Coil Length: ${coilLengthMeters.toFixed(2)} meters`;
}
</script>
</body>
</html>
π€2β€1