# Coordenate Polar to Cartesian
polar2cart = function(rho, theta, center = c(0, 0), rad = TRUE)
{
## convert degrees to radians
toRad = pi/180
if(!rad) theta = theta * toRad
## convert to cartesian coordinates
x = center[1] + rho * cos(theta)
y = center[2] + rho * sin(theta)
out = data.frame("x" = x, "y" = y)
return(out)
}#end polar2cart
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.