MissionPlanner.GridUIv2.doCalc C# (CSharp) Method

doCalc() private method

private doCalc ( ) : void
return void
        void doCalc()
        {
            try
            {
                // entered values
                float focallen = (float)num_focallength;
                float flyalt = (float)NUM_altitude.Value;
                int imagewidth = int.Parse(TXT_imgwidth);
                int imageheight = int.Parse(TXT_imgheight);

                float sensorwidth = float.Parse(TXT_senswidth);
                float sensorheight = float.Parse(TXT_sensheight);

                int overlap = (int)num_overlap;
                int sidelap = (int)num_sidelap;


                // scale      mm / mm
                float flscale = (1000 * flyalt) / focallen;

                //   mm * mm / 1000
                float viewwidth = (sensorwidth * flscale / 1000);
                float viewheight = (sensorheight * flscale / 1000);

                TXT_fovH = viewwidth.ToString("#.#");
                TXT_fovV = viewheight.ToString("#.#");

                float fovh = (float)(Math.Atan(sensorwidth / (2 * focallen)) * rad2deg * 2);
                float fovv = (float)(Math.Atan(sensorheight / (2 * focallen)) * rad2deg * 2);

                //    mm  / pixels * 100
                TXT_cmpixel = ((viewheight / imageheight) * 100);

                if (!RAD_camdirectionport.Checked)
                {
                    NUM_spacing = ((1 - (overlap / 100.0f)) * viewheight);
                    NUM_Distance = ((1 - (sidelap / 100.0f)) * viewwidth);
                }
                else
                {
                    NUM_spacing = ((1 - (overlap / 100.0f)) * viewwidth);
                    NUM_Distance = ((1 - (sidelap / 100.0f)) * viewheight);
                }

            }
            catch { return; }
        }