pendulum | R Documentation |
Simulates the 3-magnet pendulum experiment, starting at a specified position with a given start velocity.
pendulum( startpos = c(-2, 2), startvel = c(0, 0), src = rbind(c(0, 0), c(0.5, sqrt(0.75)), c(1, 0)), plot = TRUE )
startpos |
2-element vecotor with the initial position |
startvel |
2-element vector with the initial velocity |
src |
n \times 2 matrix with the positions of the magnets |
plot |
logical. If |
the end position of the pendulum
p <- par(mfrow=c(1,2)) pendulum(startpos=c(2.1,2)) pendulum(startpos=c(1.9,2)) par(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.