I am given (x,y) points and I know the radius. I want to to find the angle of each point on circle. In the future I want to use this code as part of a test whether the angles are distributed uniformly on the interval [0,2Pi].
The code I've tried is
b <- matrix(c(d[,2],d[,5]),ncol=2)
S <- (b/sqrt((rowSums(b^2))))
#S <- matrix(S[!is.na(S)],ncol=2)
lim <- c(-1,1)
plot(S,xlim=lim,ylim=lim,xlab=expression(S1),ylab=expression(S2))
#S<-S[!is.na(S)]
U <- matrix(c(0),nrow=nrow(S),ncol=1)
for (i in 1:nrow(S)) {
U[i,1] <- (atan(abs(S[i,1]/S[i,2])))
}
That code gave me some angles, but none lay in the interval [270,360].