calculator
<!DOCTYPE html>
<html>
<head>
<style>
body{
font-family:Arial,sans-serif;
background:#f5f5f5;
}
.container{
max-width:500px;
margin:20px auto;
background:#fff;
padding:20px;
border-radius:10px;
box-shadow:0 0 10px rgba(0,0,0,0.2);
}
input{
width:100%;
padding:10px;
margin:8px 0;
font-size:16px;
}
button{
width:100%;
padding:12px;
background:#0073aa;
color:white;
border:none;
border-radius:5px;
font-size:18px;
cursor:pointer;
}
button:hover{
background:#005177;
}
.result{
margin-top:20px;
font-size:18px;
font-weight:bold;
}
</style>
</head>
<body>
<div class="container">
<h2>CNC RPM & Feed Rate Calculator</h2>
<label>Tool Diameter (mm)</label>
<input type="number" id="diameter">
<label>Cutting Speed (m/min)</label>
<input type="number" id="speed">
<label>Feed per Tooth (mm)</label>
<input type="number" id="fpt">
<label>Number of Flutes</label>
<input type="number" id="flutes">
<button onclick="calculate()">Calculate</button>
<div class="result" id="result"></div>
</div>
<script>
function calculate(){
let d=parseFloat(document.getElementById("diameter").value);
let vc=parseFloat(document.getElementById("speed").value);
let fz=parseFloat(document.getElementById("fpt").value);
let z=parseInt(document.getElementById("flutes").value);
let rpm=(1000*vc)/(Math.PI*d);
let feed=rpm*z*fz;
document.getElementById("result").innerHTML=
"Spindle Speed (RPM): <b>"+rpm.toFixed(0)+"</b><br><br>"+
"Feed Rate (mm/min): <b>"+feed.toFixed(0)+"</b>";
}
</script>
</body>
</html>