Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- polar <- function(ang,r){
- return(cbind(
- cos(ang/180*pi)*r ,
- sin(ang/180*pi)*r
- ))
- }
- ang1 = seq(10,170,length.out=5)
- ang2 = seq(10,170,length.out=20)
- points1 = polar(ang=ang1,r=1)
- points2 = polar(ang=ang2,r=2)
- plot(points2, xlim=c(-2.5,2.5), ylim=c(-0.5,2.5))
- points(points1)
- for(i in 1:nrow(points1)){
- lines(rbind(c(0,0),points1[i,]))
- }
- for(i in 1:nrow(points1)){
- for(j in 1:4){
- lines(rbind(points1[i,],points2[(i-1)*4+j,]))
- }
- }
Add Comment
Please, Sign In to add comment