Exemplo n.º 1
0
		/// <summary>
		/// </summary>
		/// <param name="parent"></param>
		/// <returns></returns>
		public override string ToString(NuGenFormulaElement parent)
		{
			NuGenOperator parentop = parent as NuGenOperator;
			if (parentop != null && parentop.Preference > 1)
				return string.Format("({0})", this.ToString());
			else
				return this.ToString();
		}
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NuGenFunction"/> class.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// <para><paramref name="element"/> is <see langword="null"/>.</para>
        /// </exception>
        public NuGenFunction(NuGenFormulaElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }

            _element = element;
        }
Exemplo n.º 3
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenFunction"/> class.
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="element"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenFunction(NuGenFormulaElement element)
		{
			if (element == null)
			{
				throw new ArgumentNullException("element");
			}

			_element = element;
		}
Exemplo n.º 4
0
        /// <summary>
        /// </summary>
        /// <param name="parent"></param>
        /// <returns></returns>
        public override string ToString(NuGenFormulaElement parent)
        {
            NuGenOperator parentop = parent as NuGenOperator;

            if (parentop != null && parentop.Preference > 1)
            {
                return(string.Format("({0})", this.ToString()));
            }
            else
            {
                return(this.ToString());
            }
        }
Exemplo n.º 5
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenOperator"/> class.
		/// </summary>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="left"/> is <see langword="null"/>.</para>
		/// -or-
		/// <para><paramref name="right"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenOperator(NuGenFormulaElement left, NuGenFormulaElement right)
		{
			if (left == null)
			{
				throw new ArgumentNullException("left");
			}

			if (right == null)
			{
				throw new ArgumentNullException("right");
			}

			_left = left;
			_right = right;
		}
Exemplo n.º 6
0
		private NuGenFormula(string formel, NuGenPlotInterval intervall, Color frb, bool draw, NuGenFormula[] children, double param)
		{
			_formel = formel;
			_children = new NuGenFormulaCollectionBase();
			if (children != null)
				_children.AddRange(children);
			this._param = param;
			this._formulaElement = NuGenInterpreter.ParseInfixExpression(formel);
			this._interval = intervall;
			this.frb = frb;
			this._paintValidate = new NuGenPlotInterval(0.0, 0.0);
			this.draw = draw;
			_pth = new GraphicsPath();
			_pthasympt = new GraphicsPath();
		}
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NuGenOperator"/> class.
        /// </summary>
        /// <exception cref="ArgumentNullException">
        /// <para><paramref name="left"/> is <see langword="null"/>.</para>
        /// -or-
        /// <para><paramref name="right"/> is <see langword="null"/>.</para>
        /// </exception>
        public NuGenOperator(NuGenFormulaElement left, NuGenFormulaElement right)
        {
            if (left == null)
            {
                throw new ArgumentNullException("left");
            }

            if (right == null)
            {
                throw new ArgumentNullException("right");
            }

            _left  = left;
            _right = right;
        }
Exemplo n.º 8
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenPower"/> class.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <exception cref="ArgumentNullException">
		/// 	<para><paramref name="left"/> is <see langword="null"/>.</para>
		/// -or-
		/// <para><paramref name="right"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenPower(NuGenFormulaElement left, NuGenFormulaElement right)
			: base(left, right)
		{
		}
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenFac"/> class.
 /// </summary>
 /// <param name="element"></param>
 /// <exception cref="ArgumentNullException"><paramref name="element"/> is <see langword="null"/>.</exception>
 public NuGenFac(NuGenFormulaElement element)
     : base(element)
 {
 }
Exemplo n.º 10
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenMultiplication"/> class.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <exception cref="ArgumentNullException">
		/// 	<para><paramref name="left"/> is <see langword="null"/>.</para>
		/// -or-
		/// <para><paramref name="right"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenMultiplication(NuGenFormulaElement left, NuGenFormulaElement right)
			: base(left, right)
		{
		}
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenRemainder"/> class.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <exception cref="ArgumentNullException">
 ///     <para><paramref name="left"/> is <see langword="null"/>.</para>
 /// -or-
 /// <para><paramref name="right"/> is <see langword="null"/>.</para>
 /// </exception>
 public NuGenRemainder(NuGenFormulaElement left, NuGenFormulaElement right)
     : base(left, right)
 {
 }
Exemplo n.º 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenAddition"/> class.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <exception cref="ArgumentNullException">
 ///     <para><paramref name="left"/> is <see langword="null"/>.</para>
 /// -or-
 /// <para><paramref name="right"/> is <see langword="null"/>.</para>
 /// </exception>
 public NuGenAddition(NuGenFormulaElement left, NuGenFormulaElement right)
     : base(left, right)
 {
 }
Exemplo n.º 13
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenSubtraction"/> class.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <exception cref="ArgumentNullException">
		/// 	<para><paramref name="left"/> is <see langword="null"/>.</para>
		/// -or-
		/// <para><paramref name="right"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenSubtraction(NuGenFormulaElement left, NuGenFormulaElement right)
			: base(left, right)
		{
		}
Exemplo n.º 14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenPower"/> class.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <exception cref="ArgumentNullException">
 ///     <para><paramref name="left"/> is <see langword="null"/>.</para>
 /// -or-
 /// <para><paramref name="right"/> is <see langword="null"/>.</para>
 /// </exception>
 public NuGenPower(NuGenFormulaElement left, NuGenFormulaElement right)
     : base(left, right)
 {
 }
Exemplo n.º 15
0
 /// <summary>
 /// </summary>
 public virtual string ToString(NuGenFormulaElement parent)
 {
     return(this.ToString());
 }
Exemplo n.º 16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenMultiplication"/> class.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <exception cref="ArgumentNullException">
 ///     <para><paramref name="left"/> is <see langword="null"/>.</para>
 /// -or-
 /// <para><paramref name="right"/> is <see langword="null"/>.</para>
 /// </exception>
 public NuGenMultiplication(NuGenFormulaElement left, NuGenFormulaElement right)
     : base(left, right)
 {
 }
Exemplo n.º 17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenAbs"/> class.
 /// </summary>
 /// <param name="elem">The elem.</param>
 public NuGenAbs(NuGenFormulaElement elem)
     : base(elem)
 {
 }
Exemplo n.º 18
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenSin"/> class.
		/// </summary>
		/// <param name="element"></param>
		/// <exception cref="ArgumentNullException"><paramref name="element"/> is <see langword="null"/>.</exception>
		public NuGenSin(NuGenFormulaElement element)
			: base(element)
		{
		}
Exemplo n.º 19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenDivision"/> class.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <exception cref="ArgumentNullException">
 ///     <para><paramref name="left"/> is <see langword="null"/>.</para>
 /// -or-
 /// <para><paramref name="right"/> is <see langword="null"/>.</para>
 /// </exception>
 public NuGenDivision(NuGenFormulaElement left, NuGenFormulaElement right)
     : base(left, right)
 {
 }
Exemplo n.º 20
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenLog"/> class.
		/// </summary>
		/// <param name="element"></param>
		/// <exception cref="ArgumentNullException"><paramref name="element"/> is <see langword="null"/>.</exception>
		public NuGenLog(NuGenFormulaElement element)
			: base(element)
		{
		}
Exemplo n.º 21
0
		private float GetValIS(NuGenFormulaElement fml, double val)
		{
			NuGenInterpreter.SetVariableValue(_varx, val);
			float res = (float)fml.Value;
			if (float.IsNaN(res))
				return 0f;
			else if (float.IsPositiveInfinity(res))
				return 2e30f;
			else if (float.IsNegativeInfinity(res))
				return -2e30f;
			else
				return res;
		}
Exemplo n.º 22
0
		private float GetVal(NuGenFormulaElement fml, double val)
		{
			return Math.Min(1e4f, Math.Max(GetValIS(fml, val), -1e4f));
		}
Exemplo n.º 23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NuGenSubtraction"/> class.
 /// </summary>
 /// <param name="left"></param>
 /// <param name="right"></param>
 /// <exception cref="ArgumentNullException">
 ///     <para><paramref name="left"/> is <see langword="null"/>.</para>
 /// -or-
 /// <para><paramref name="right"/> is <see langword="null"/>.</para>
 /// </exception>
 public NuGenSubtraction(NuGenFormulaElement left, NuGenFormulaElement right)
     : base(left, right)
 {
 }
Exemplo n.º 24
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenDivision"/> class.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <exception cref="ArgumentNullException">
		/// 	<para><paramref name="left"/> is <see langword="null"/>.</para>
		/// -or-
		/// <para><paramref name="right"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenDivision(NuGenFormulaElement left, NuGenFormulaElement right)
			: base(left, right)
		{
		}
Exemplo n.º 25
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenAbs"/> class.
		/// </summary>
		/// <param name="elem">The elem.</param>
		public NuGenAbs(NuGenFormulaElement elem)
			: base(elem)
		{
		}
Exemplo n.º 26
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenRemainder"/> class.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <exception cref="ArgumentNullException">
		/// 	<para><paramref name="left"/> is <see langword="null"/>.</para>
		/// -or-
		/// <para><paramref name="right"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenRemainder(NuGenFormulaElement left, NuGenFormulaElement right)
			: base(left, right)
		{
		}
Exemplo n.º 27
0
		/// <summary>
		/// </summary>
		public virtual string ToString(NuGenFormulaElement parent)
		{
			return this.ToString();
		}
Exemplo n.º 28
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenAddition"/> class.
		/// </summary>
		/// <param name="left"></param>
		/// <param name="right"></param>
		/// <exception cref="ArgumentNullException">
		/// 	<para><paramref name="left"/> is <see langword="null"/>.</para>
		/// -or-
		/// <para><paramref name="right"/> is <see langword="null"/>.</para>
		/// </exception>
		public NuGenAddition(NuGenFormulaElement left, NuGenFormulaElement right)
			: base(left, right)
		{
		}