TimeBegin, TimeEnd, TimeRange, InitialTime

Time of the animation

Value Summary

InitialTime, TimeBegin, TimeEndInheritedReal number
TimeRange[TimeBegin .. TimeEnd]Range of arithmetical expressions

Graphics Primitives

ObjectsDefault Values
plot::Canvas 

Description

TimeBegin = t0 defines the starting time t0 of the animation of an object.

TimeEnd = t1 defines the time t1 for the end of the animation.

TimeRange = t_0 .. t_1 is a short cut for setting both TimeBegin = t0 and TimeEnd = t1.

InitialTime = t2 defines the time t2 for the initial position of the animation slider.

Animations are defined object by object. Each animated object is animated for a certain time span specified by TimeBegin and TimeEnd setting the real start and end time in seconds.

The total real time span of an animated plot is the physical real time given by the minimum of the TimeBegin values of all animated objects in the plot to the maximum of the TimeEnd values of all the animated objects:

  • When a plot containing animated objects is created, the real time clock is set to the minimum of the TimeBegin values of all animated objects in the plot. The real time clock is started when pushing the `play' button for animations in the graphical user interface.

  • Before the real time reaches the TimeBegin value t0 of an animated object, this object is static in the state corresponding to the begin of its animation. Depending on the attribute VisibleBeforeBegin, it may be visible or invisible before t0.

  • During the time from t0 to t1, the object changes from its original to its final state.

  • After the real time reaches the TimeEnd value t1, the object stays static in the state corresponding to the end of its animation. Depending on the attribute VisibleAfterEnd, it may stay visible or become invisible after t1.

  • The animation of the entire plot ends with the physical time given by the maximum of the TimeEnd values of all animated objects in the plot.

If all animated objects in a plot share the same values TimeBegin = t0 and TimeEnd = t1, the physical time span of the animation is t1 - t0 (in seconds). During this time, all animated objects change from their initial to their final state.

Separate settings for TimeBegin and TimeEnd in different animated objects allow to synchronize the animations.

With the optional attribute InitialTime the initial position of the animation slider can be set to any time value t2 between t0 and t1. If InitialTime is not set, the slider will be placed at the beginning of the animation.

The attributes VisibleAfter, VisibleBefore, and VisibleFromTo allow special "visibility animations" in which objects are visible for a limited time only.

    Note:   The attributes VisibleAfter, VisibleBefore, and VisibleFromTo implicitly set values for TimeBegin and TimeEnd (and, therefore, also for TimeRange). Consequently, these attributes should not be used simultaneously in the definition of an animated object.

Examples

Example 1

By default, an animation plays for 10 seconds. Keeping the default value TimeBegin = 0, this time can be reduced to 5 seconds by setting TimeEnd = 5:

plot(plot::Function2d(sin(a*x), x= - PI .. PI, a = -PI..PI, 
                      TimeEnd = 5)):

The total time of the animation is the difference between TimeEnd and TimeBegin. Hence, the following animation plays 5 seconds as well:

plot(plot::Function2d(sin(a*x), x = -PI..PI, a = -PI..PI, 
                      TimeRange = 5..10)):

Example 2

Using different time ranges allows to synchronize the animations of different objects. Here we plot two functions. The first function is animated from 0 to 5 (seconds) and then stays static in its final state. The second function stays static in its initial state for 5 seconds and is then animated in the range from 5 to 10 (seconds):

f1 := plot::Function2d(a*sin(x), x = -PI..PI, a = -1..1, 
                       Color = RGB::Red, TimeRange = 0..5):
f2 := plot::Function2d(a*cos(x), x = -PI..PI, a = -1..1, 
                       Color = RGB::Blue, TimeRange = 5..10):
plot(f1 ,f2):

Both functions are visible outside the time range of their animations. We use the attributes VisibleAfterEnd and VisibleBeforeBegin to make them visible only during their animations:

f1::VisibleAfterEnd := FALSE:
f2::VisibleBeforeBegin := FALSE:
plot(f1, f2):

delete f1, f2:

Example 3

The following animation uses the implicitly given TimeRange from 0 to 10 seconds, but the first image shown is at the time 5:

plot(plot::Function2d(a*sin(x), x = -PI..PI, a = -1..1), 
                      InitialTime=5):

Was this topic helpful?