Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="field"></param>
        /// <param name="point"></param>
        /// <param name="amount"></param>
        public static void IncrementAt(this GridField2d <Vector2d> field, ref GridPoint2d point, Vector2d amount)
        {
            var vals = field.Values;

            vals[point.Index0] += amount * point.Weight0;
            vals[point.Index1] += amount * point.Weight1;
            vals[point.Index2] += amount * point.Weight2;
            vals[point.Index3] += amount * point.Weight3;
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="field"></param>
        /// <param name="point"></param>
        /// <param name="value"></param>
        public static void SetAt(this GridField2d <Vector2d> field, ref GridPoint2d point, Vector2d value)
        {
            var vals = field.Values;

            vals[point.Index0] += (value - vals[point.Index0]) * point.Weight0;
            vals[point.Index1] += (value - vals[point.Index1]) * point.Weight1;
            vals[point.Index2] += (value - vals[point.Index2]) * point.Weight2;
            vals[point.Index3] += (value - vals[point.Index3]) * point.Weight3;
        }
Ejemplo n.º 3
0
        /// <inheritdoc />
        public sealed override double ValueAt(ref GridPoint2d point)
        {
            var vals = Values;

            return
                (vals[point.Index0] * point.Weight0 +
                 vals[point.Index1] * point.Weight1 +
                 vals[point.Index2] * point.Weight2 +
                 vals[point.Index3] * point.Weight3);
        }