const toRadians = (degrees) => degrees * Math.PI / 180; const distance = (x1, y1, x2, y2) => { const deltaX = x2 - x1; const deltaY = y2 - y1; return Math.hypot(deltaX, deltaY); } document.getElementById("ok").addEventListener("click", () => { const x1 = document.getElementById("x1").value; const y1 = document.getElementById("y1").value; const x2 = document.getElementById("x2").value; const y2 = document.getElementById("y2").value; /*const inputValue = document.getElementById("coordinaten").value; const coordinates = inputValue.split(";"); const x1 = coordinates[0]; const y1 = coordinates[1]; const x2 = coordinates[2]; const y2 = coordinates[3]; */ const h = distance( Number.parseFloat(x1), Number.parseFloat(y1), Number.parseFloat(x2), Number.parseFloat(y2) ) document.getElementById("output").textContent = `${h}`; })