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.

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: