Михендр,
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<form name="numbers">
<div>Первое число:<br>
<input type="text" name="number1">
</div>
<div>Второе число:<br>
<input type="text" name="number2">
</div>
<div>
Математическая операция:<br>
<input type="radio" name="operation" value="plus" > + <br>
<input type="radio" name="operation" value="minus"> - <br>
</div>
<div>Результат:<br>
<input type="text" name="result">
<input id="calculate" type="button" value="Посчитать">
</div>
</form>
<script>
function value1() {
var numberOne = +document.forms[0].number1.value||0;
var numberTwo = +document.forms[0].number2.value||0;
var oper = document.forms[0].operation[1].checked ? document.forms[0].operation[1]:document.forms[0].operation[0];
var value;
if (oper.value === 'plus') {
value = numberOne + numberTwo;
} else {
value = numberOne - numberTwo;
}
return value
}
function mathOperByPi(value) {
return value * Math.PI;
}
document.getElementById('calculate').onclick = function(){
document.forms[0].result.value = mathOperByPi(value1());
};
</script>
</body>
</html>