Polar rose

It’s fascinating to see how simple mathematical transformations look like in different coordinate systems.  ”Polar rose” is the name of a mathematical curve – described by the polar equation:

r(\Phi) = a \cos(k\Phi + \phi_0)

Below is a small code to draw it in R using the ggplot2 package:

require(ggplot2)

#data points
p <- data.frame(t=seq(-2*pi, 2*pi, 0.1))

#1.. drawing polar rose
c <- ggplot(p, aes(x=t, y=cos(3*t)))
c + geom_line(colour="red", size=1.5) + coord_polar()

#2.. another one with sine
c <- ggplot(p, aes(x=t, y=2*sin(4*t)))
c + geom_line(colour="red", size=1.5) + coord_polar()

…and the output

Advertisement
This entry was posted in math, notes and tagged . Bookmark the permalink.

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 )

Connecting to %s