Example #1
0
        /// <summary>
        ///     Performs Tangent Function on number in textDisplay
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnTangent_Click(object sender, EventArgs e)
        {
            try
            {
                var result = Trigonometric.Tangent(double.Parse(txtDisplay.Text));
                if (double.IsNaN(result.Value) == null)
                {
                    txtDisplay.Text = Resources.invalidText;
                    _tempValue      = 0;
                }
                else
                {
                    txtDisplay.Text = result.ToString();
                    _tempValue      = 0;
                }
            }
            catch (Exception)
            {
                txtDisplay.Text = Resources.invalidText;
                _tempValue      = 0;
            }

            btnEquals.Select();
            _clear = true;
        }
Example #2
0
        /// <summary>
        ///     Performs Cosine Function on number in textDisplay
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCosine_Click(object sender, EventArgs e)
        {
            try
            {
                var result = Trigonometric.Cosine(double.Parse(txtDisplay.Text));
                txtDisplay.Text = result.ToString(CultureInfo.InvariantCulture);
                _tempValue      = 0;
            }
            catch (Exception)
            {
                txtDisplay.Text = Resources.invalidText;
            }

            btnEquals.Select();
            _clear = true;
        }
Example #3
0
 public static void Main(string[] args)
 {
     Console.WriteLine(Arithmetic.add(5, 4));
     Console.WriteLine(Area.areaOfRectangle(8, 7));
     Console.WriteLine(Trigonometric.findHypotenuse(3, 4));
 }