#' Provide ellipse properties to create it
#'
#' @param Rx X-radius. Defults to 300
#' @param Ry Y-radius. Defults to 200
#' @param Cx X-center. Defults to 250
#' @param Cy Y-center. Defults to 150
#' @param Rotation Radians. Defults to 0.4
#' @param NoiseLevel Gaussian Noise level. Defults to 0.5
create.test.ellipse <- function(Rx=300, # X-radius
Ry=200, # Y-radius
Cx=250, # X-center
Cy=150, # Y-center
Rotation=0.4, # Radians
NoiseLevel=0.5) # Gaussian Noise level
{
set.seed(42)
t <- seq(0, 100, by=1)
x <- Rx * cos(t)
y <- Ry * sin(t)
nx <- x*cos(Rotation)-y*sin(Rotation) + Cx
nx <- nx + rnorm(length(t))*NoiseLevel
ny <- x*sin(Rotation)+y*cos(Rotation) + Cy
ny <- ny + rnorm(length(t))*NoiseLevel
cbind(x=nx, y=ny)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.