01: package prefuse.activity;
02:
03: /**
04: * Pacing function that maps the animation fraction f such that it ranges
05: * from 0 to 1 and then back to 0 again. This is useful for animations
06: * with periodic activity.
07: *
08: * @author <a href="http://jheer.org">jeffrey heer</a>
09: */
10: public class ThereAndBackPacer implements Pacer {
11:
12: /**
13: * Pacing function for providing there-and-back (periodic) transitions.
14: * @see prefuse.activity.Pacer#pace(double)
15: */
16: public double pace(double f) {
17: return 2 * (f <= 0.5 ? f : (1 - f));
18: }
19:
20: } // end of class ThereAndBackPacer
|