I\'ve been looking for a solution to convert cartesian coordinates (lat, long) that I have to polar coordinates in order to facilitate a simulation that I want to run, but I hav
I think you can do transformation bewteen catesian and polar this way:
polar2cart <- function(r, theta) { data.frame(x = r * cos(theta), y = r * sin(theta)) } cart2polar <- function(x, y) { data.frame(r = sqrt(x^2 + y^2), theta = atan2(y, x)) }