System.Linq.Expressions.Expression.Divide C# (CSharp) Method

Divide() public static method

Creates a BinaryExpression that represents an arithmetic division operation.
public static Divide ( Expression left, Expression right ) : BinaryExpression
left Expression An to set the property equal to.
right Expression An to set the property equal to.
return BinaryExpression
        public static BinaryExpression Divide(Expression left, Expression right)
        {
            return Divide(left, right, method: null);
        }

Same methods

Expression::Divide ( Expression left, Expression right, MethodInfo method ) : BinaryExpression

Usage Example

Ejemplo n.º 1
0
        /// <summary>
        /// Home towards a target location at a fixed speed.
        /// </summary>
        /// <remarks>
        /// Use with StopSampling to home for only a few seconds.
        /// <para>This is primarily for use with non-rotational velocity.
        /// Rotational use creates: contracting spirals (0,90), circle around player [90], expanding spiral (90,180).</para>
        /// </remarks>
        /// <param name="speed">Speed</param>
        /// <param name="location">Target location</param>
        /// <returns></returns>
        public static ExTP VHome(ExBPY speed, ExTP location)
        {
            TExV2 l = new TExV2();

            return(bpi => Ex.Block(new ParameterExpression[] { l },
                                   Ex.Assign(l, location(bpi).Sub(bpi.loc)),
                                   l.Mul(Ex.Divide(speed(bpi), Sqrt(Ex.Add(SqrMag(l), EPS))))
                                   ));
        }
All Usage Examples Of System.Linq.Expressions.Expression::Divide
Expression