WeightedTransition
This class is used for objects that perform smooth transitions between two functions of one variable. Denoting the transition begin and end points by and , respectively, and the "left" and "right" functions by and , respectively, the transition function is the following: where the weight is between 0 and 1 and is computed with a cosine function: The transitioned function has the following desirable properties:
is continuous throughout the interval (including at the end points), so long as and are also continuous on this interval.
is continuous throughout the interval (including at the end points), so long as and are also continuous on this interval.
An example of the transition is illustrated in Figure 1, where is transition is created in the region at a discontinuity:

Figure 1: Weighted transition at a discontinuity
Note that the transition can exit the bounds of the non-transitioned piecewise function, which can be undesirable. This is illustrated in Figure 2, where compares this weighted approach with the approach of CubicTransition:

Figure 2: Transition at the intersection of two functions
Thus when the transition occurs at the intersection of two functions, it may be advantageous to use CubicTransition instead of WeightedTransition
, whereas transitions at a discontinuity may be handled well with WeightedTransition
.