Some More Tinkering

After yesterday’s discussion of springs and sine graphs, I remembered a post from 2012, “Daydreams, Lectures, and Helices.” I decided to figure out how to graph a helix in R.

Well, after installing the rgl package and experimenting a bit, I got it to work.

helix

Here’s the code:

require(rgl)
x=seq(0.01,6.29,0.01)
y=seq(0.01,6.29,0.01)
z=seq(0.01,40,0.01)
plot3d(cos(x), sin(y), z, col=”red”, size=3)

I then rotated it into a good view. As my Latin teacher used to say, that’s all there is to it!

Next up (at some point): an animation of a spring.