R/pol2cart_circle.R

Defines functions pol2cart_circle

## function to convert from polar to cartesian coordinates
#' @keywords internal
#' @noRd

pol2cart_circle <- function(theta, r=1){
  for(i in 1:length(theta)){
    mat_cart <- matrix(NA, nrow=length(theta), ncol=2)
    #mat_cart <- c()
    x <- vector()
    y <- vector()
    x <- r*cos(theta)
    y <- r*sin(theta)
    mat_cart <- cbind(x, y)
  }
  return(mat_cart)
}

Try the bpDir package in your browser

Any scripts or data that you put into this service are public.

bpDir documentation built on Nov. 9, 2026, 9:07 a.m.