#' Calculate points on an ellipse described by the fit argument as returned by fit.ellipse.
#'
#' Function to calculate the points of the ellipse.
#'
#' @param fit A list object output from fil.ellipse() function
#' @param n Number of points to render. Defults to n=360.
#' @export
get.ellipse <- function( fit, n=360 )
{
tt <- seq(0, 2*pi, length=n)
sa <- sin(fit$angle)
ca <- cos(fit$angle)
ct <- cos(tt)
st <- sin(tt)
x <- fit$center[1] + fit$maj * ct * ca - fit$min * st * sa
y <- fit$center[2] + fit$maj * ct * sa + fit$min * st * ca
cbind(x=x, y=y)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.