Exemplo n.º 1
0
 private void btnCalcValueAt_Click(object sender, EventArgs e)
 {
     try
     {
         Explicit2DFunction explicitFunction = null;
         explicitFunction = new Explicit2DFunction(txtExplicitFunction.Text);
         txtYValuleAt.Text = explicitFunction.ValueAt((double)nudValueAt.Value).ToString();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "MathX Demo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
Exemplo n.º 2
0
		public static Explicit2DFunction InverseExplicit2DFunction(Explicit2DFunction function)
		{
			if (function == null)
				throw new ArgumentNullException("function");

			switch (function.DefinitionType)
			{
				case DefinitionType.Analytic:
					return new Explicit2DFunction(
						string.Format("1/({0})",function.Expression));
				case DefinitionType.Numerical:
					return new Explicit2DFunction(
						DelegateFactory.InverseFunction(function.ValueAt));					
			}
			return null;
		}
Exemplo n.º 3
0
        private void btnCalcDerivative_Click(object sender, EventArgs e)
        {
            Function function = null;
            try
            {
                function = new Explicit2DFunction(txtExplicitFunction.Text);
                for (int i = 1; i <= nudDerivative.Value; i++)
                {
                    function = function.Derivative;
                }
                txtExplicitResult.Text = function.Expression;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "MathX Demo", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

        }
Exemplo n.º 4
0
        public static Explicit2DFunction InverseExplicit2DFunction(Explicit2DFunction function)
        {
            if (function == null)
            {
                throw new ArgumentNullException("function");
            }

            switch (function.DefinitionType)
            {
            case DefinitionType.Analytic:
                return(new Explicit2DFunction(
                           string.Format("1/({0})", function.Expression)));

            case DefinitionType.Numerical:
                return(new Explicit2DFunction(
                           DelegateFactory.InverseFunction(function.ValueAt)));
            }
            return(null);
        }
Exemplo n.º 5
0
 private void btnCalcInvert_Click(object sender, EventArgs e)
 {
     try
     {
         Explicit2DFunction function = new Explicit2DFunction(txtExplicitFunction.Text);
         Explicit2DFunction invertFunction = FunctionFactory.InverseExplicit2DFunction(function);
         txtInvertFunction.Text = invertFunction.Expression;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "MathX Demo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
 }
		public Explicit2DFunctionPlotter(Explicit2DFunction function) 
		{
			_function = function.ValueAt;
		}