

	function cal() {
	
	    
	    // variables
       
        
        //variables user can enter
        var C13= parseFloat(document.getElementById("C13").value);
        var C14= parseFloat(document.getElementById("C14").value);
        var C15= parseFloat(document.getElementById("C15").value);
       
       
       
        
        //variables that get calculated according to their formula
        var C16= parseFloat(C13) * 3.14159 * (parseFloat(C14)/60);
        
         
     
        
        //var C17=  (2.7776 * Math.pow(C13, 3) + 53.049 * Math.pow(C13, 2) - 54.105 * C13 + 15.475) * C15 * C14 * C13 * 0.001745278;
        
        //var C17=(-0.357 * Math.pow(C13, 6) +0.7575 * Math.pow(C13, 5) - 4.7826 *Math.pow(C13, 4) + 1.777* Math.pow(C13, 3) + 23.571* Math.pow(C13, 2) - 46.133 * C13  +16.726) * C15 /50 *C14;
        
        var C17=(-0.0357 * Math.pow(C13, 6)+ 0.7575 * Math.pow(C13, 5)-4.7826 *Math.pow(C13, 4)+11.777* Math.pow(C13, 3)+23.571* Math.pow(C13, 2)- 46.133 * C13+16.726)* C15/50*C14;
        
        
        var C18= parseFloat(C17) * 0.85;
        
        
        
        
        //variables for unit conversions:
        var E13= parseFloat(C13) * 25.4;
        var E17= parseFloat(C17) / 2.2;
        var E18= parseFloat(E17) * 0.85;
        
        
       
       
        //assign new values to form field after calculation:
        
        //new entered values
        document.getElementById("C13").value= C13.toFixed(2);
        
        
       
        document.getElementById("C14").value= C14.toFixed(0);
        document.getElementById("C15").value= C15.toFixed(2);
        
        
        
        //calculated variables
        document.getElementById("C16").value= C16.toFixed(0);
        document.getElementById("C17").value= C17.toFixed(0);
        document.getElementById("C18").value= C18.toFixed(0);
        
        
        
        //unit conversion variables
        document.getElementById("E13").value= E13.toFixed(2);
        document.getElementById("E17").value= E17.toFixed(0);
        document.getElementById("E18").value= E18.toFixed(0);
              
        
        
	//end of function
	}

