/*
07-Jan-05
*/

function CalcForm ( poForm ) {
	var nImgPix = parseInt(poForm.imgpix.value);
	var nImgDeg = parseFloat(poForm.imgdeg.value);
	var nObjPix = parseInt(poForm.objpix.value);
	var nObjSiz = parseFloat(poForm.objsiz.value);

	var nRatio = Math.round( (nImgPix/nObjPix) * 10000 ) / 10000;
	var nFOV = Math.round( (nRatio * nObjSiz) * 1 ) / 1;
	var nTan = Math.round( Math.tan( ( (nImgDeg / 2) * Math.PI ) / 180 ) * 1000000000 ) / 1000000000;
	var nHeight = Math.round( ( (nFOV / 2) / nTan ) * 1 ) / 1;

	// If you choose not to show the detailed results,
	// you can comment out the next three lines. 
	if (poForm.resrat) { poForm.resrat.value = nRatio; }
	if (poForm.resfov) { poForm.resfov.value = nFOV; }
	if (poForm.restan) { poForm.restan.value = nTan; }

	poForm.resheight.value = nHeight;
}
