Number of frames in an animation
Frames determines the number of frames in the animation of an object.
Frames = n with a positive integer n sets the number of frames for the animation of an object to n.
The resulting frame rate is n/(t1 - t0) (frames per second).
Increasing the number of frames does not mean that the animation lasts longer, because the renderer does not work with a fixed number of frames per second.
Note that the human eye cannot distinguish between different frames if they change with a rate of more than 25 frames per second. Thus, the number of frames n for an animation should satisfy n < 25 (t1 - t0).
With the default time range TimeBegin = t0 = 0, TimeEnd = t1 = 10 (seconds), it does not make sense to specify Frames = n with n > 250. If a higher n is required to obtain a sufficient resolution of the animated object, one should increase the time for the animation by a sufficiently high value of TimeEnd.
We set the number of frames for the following animation to 40. The default animation range of 10 seconds is used. This results in a frame rate of 4 frames per second:
plot(plot::Function2d(sin(a*x), x = -PI..PI, a = 1..2, Frames = 40)):
Here is an example of different frame rates in one plot. The default animation range of 10 seconds is used.
The red point is sampled with 30 frames in 10 seconds, the blue one with 100 frames in 10 seconds. The animation of the blue point is much smoother:
plot(plot::Function2d(sin(x), x = 0..PI, Color = RGB::Black), plot::Point2d([a , sin(a) + 0.07], a = 0 .. PI, Color = RGB::Red, Frames = 30), plot::Point2d([a , sin(a) - 0.07], a = 0 .. PI, Color = RGB::Blue, Frames = 100), PointSize = 4*unit::mm):