QuinticBlend() публичный статический Метод

public static QuinticBlend ( Double t ) : Double
t Double
Результат Double
Пример #1
0
        public override Double Get(Double x, Double y, Double z, Double w)
        {
            var value     = this.Source.Get(x, y, z, w);
            var falloff   = this.Falloff.Get(x, y, z, w);
            var threshold = this.Threshold.Get(x, y, z, w);

            if (falloff > 0.0)
            {
                if (value < (threshold - falloff))
                {
                    // Lies outside of falloff area below threshold, return first source
                    return(this.Low.Get(x, y, z, w));
                }
                if (value > (threshold + falloff))
                {
                    // Lise outside of falloff area above threshold, return second source
                    return(this.High.Get(x, y, z, w));
                }
                // Lies within falloff area.
                var lower = threshold - falloff;
                var upper = threshold + falloff;
                var blend = Utilities.QuinticBlend((value - lower) / (upper - lower));
                return(Utilities.Lerp(blend, this.Low.Get(x, y, z, w), this.High.Get(x, y, z, w)));
            }

            return(value < threshold?this.Low.Get(x, y, z, w) : this.High.Get(x, y, z, w));
        }
Пример #2
0
        public override Double Get(Double x, Double y, Double z, Double w, Double u, Double v)
        {
            var numsteps = Tiers;

            if (this.Smooth)
            {
                --numsteps;
            }
            var val = Source.Get(x, y, z, w, u, v);
            var tb  = Math.Floor(val * numsteps);
            var tt  = tb + 1.0;
            var t   = val * numsteps - tb;

            tb /= numsteps;
            tt /= numsteps;
            var s = (this.Smooth ? Utilities.QuinticBlend(t) : 0.0);

            return(tb + s * (tt - tb));
        }
Пример #3
0
        public override double Get(double x, double y, double z, double w, double u, double v)
        {
            int numsteps = Tiers;

            if (Smooth)
            {
                --numsteps;
            }

            double val = Source.Get(x, y, z, w, u, v);
            double tb  = Math.Floor(val * numsteps);
            double tt  = tb + 1.0;
            double t   = val * numsteps - tb;

            tb /= numsteps;
            tt /= numsteps;
            double s = (Smooth ? Utilities.QuinticBlend(t) : 0.0);

            return(tb + s * (tt - tb));
        }