예제 #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();
		}
예제 #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;
        }
예제 #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;
		}
예제 #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());
            }
        }
예제 #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;
		}
예제 #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();
		}
예제 #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;
        }
예제 #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)
		{
		}
예제 #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)
 {
 }
예제 #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)
		{
		}
예제 #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)
 {
 }
예제 #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)
 {
 }
예제 #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)
		{
		}
예제 #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)
 {
 }
예제 #15
0
 /// <summary>
 /// </summary>
 public virtual string ToString(NuGenFormulaElement parent)
 {
     return(this.ToString());
 }
예제 #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)
 {
 }
예제 #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)
 {
 }
예제 #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)
		{
		}
예제 #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)
 {
 }
예제 #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)
		{
		}
예제 #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;
		}
예제 #22
0
		private float GetVal(NuGenFormulaElement fml, double val)
		{
			return Math.Min(1e4f, Math.Max(GetValIS(fml, val), -1e4f));
		}
예제 #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)
 {
 }
예제 #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)
		{
		}
예제 #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)
		{
		}
예제 #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)
		{
		}
예제 #27
0
		/// <summary>
		/// </summary>
		public virtual string ToString(NuGenFormulaElement parent)
		{
			return this.ToString();
		}
예제 #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)
		{
		}