コード例 #1
0
        protected static double basicInterpolant(double interpolant, double startInterpolant,
                                                 double stopInterpolant,
                                                 int maxSmoothing)
        {
            var normalizedInterpolant = AnimationSupport.interpolantNormalized(interpolant, startInterpolant,
                                                                               stopInterpolant);

            return(AnimationSupport.interpolantSmoothed(normalizedInterpolant, maxSmoothing));
        }
コード例 #2
0
        private double zoomInterpolant(double interpolant, double startInterpolant, double stopInterpolant,
                                       int maxSmoothing)
        {
            // Map interpolant in to range [start, stop].
            double normalizedInterpolant = AnimationSupport.interpolantNormalized(
                interpolant, startInterpolant, stopInterpolant);

            // During first half of iteration, zoom increases from begin to mid,
            // and decreases from mid to end during second half.
            if (normalizedInterpolant <= 0.5)
            {
                normalizedInterpolant = (normalizedInterpolant * 2.0);
            }
            else
            {
                normalizedInterpolant = ((normalizedInterpolant - .5) * 2.0);
            }

            return(AnimationSupport.interpolantSmoothed(normalizedInterpolant, maxSmoothing));
        }