WFA_psychometric_chart.Form1_main.CalculateYFromXandEnthalpy C# (CSharp) Method

CalculateYFromXandEnthalpy() public method

public CalculateYFromXandEnthalpy ( double dbt, double enthalpy ) : double
dbt double
enthalpy double
return double
        public double CalculateYFromXandEnthalpy(double dbt, double enthalpy)
        {
            //this is DBT 
            double x_axis = dbt;
            double h = enthalpy;
            // MessageBox.Show("h = " + h+" T = "+dbt);

            //lets fit this value in the curve...
            double x1 = (h - 12.5) / 3.5;
            //        MessageBox.Show("X1= " + x1);
            double y1 = x1 + 5;//this is given temp..
            //      MessageBox.Show("y1= " + y1);
            double x2 = h;
            double y2 = 0;

            //MessageBox.Show("x2= " + x2+" y2  = "+y2);

            double x = dbt;
            double y = y1 + (((y2 - y1) * (x - x1) / (x2 - x1)));

            double y_axis = y;
            return y_axis;
        }
Form1_main