## Animations generated in R version 3.2.1 (2015-06-18)
## using the package animation
library(animation)
timeStep <- 0.2
xlim <- c(-10, 10)
ylim <- c(-5, 15)
my.barbell <- barbell(omega = 10, p = 0, x = 12, l = 3, HookeConstant = 60,
AirResistance = 0.08)
for (i in 1:500) {
plot.new()
plot.window(xlim, ylim)
abline(-1, 0, col = "red")
draw(my.barbell)
my.barbell <- evolve(my.barbell, timeStep)
}
## R version 3.2.1 (2015-06-18)
## Platform: x86_64-redhat-linux-gnu (64-bit)
## Other packages: animation 2.4