Re: [R] Rotation of parallel lines

2013-11-19 Thread David Winsemius
On Nov 19, 2013, at 5:53 AM, Tonio wrote: > Thank you for your post. I believe that it is possible to make a function to > rotate a graphical component that might be based on the rotation matrix. > > > I'll take a look to the packages anyway... It's certainly possible to "rotate" abstract s

Re: [R] Rotation of parallel lines

2013-11-18 Thread Carl Witthoft
See my answer at Stack Overflow -- repeated here for anyone else who wants a trivial function. # coordinate transform: cartesian plane rotation xyrot<-function(pairs,ang){ # pairs must be Nx2 matrix w/ x in first column and y in second xrot <- pairs[,1]*cos(ang) - pairs[,2]*sin(ang)

Re: [R] Rotation of parallel lines

2013-11-18 Thread David Winsemius
On Nov 18, 2013, at 7:27 AM, Tonio wrote: Dear list, Consider these two parallel segments in a plot. plot(c(1, 6), c(2, 2), type="n", xlim=c(0, 7), ylim=c(-2, 6)) segments(1, 1, 6, 1) segments(1, 3, 6, 3) How can I rotate the two lines together by a defined angle? Base graphics do not

[R] Rotation of parallel lines

2013-11-18 Thread Tonio
Dear list, Consider these two parallel segments in a plot. plot(c(1, 6), c(2, 2), type="n", xlim=c(0, 7), ylim=c(-2, 6)) segments(1, 1, 6, 1) segments(1, 3, 6, 3) How can I rotate the two lines together by a defined angle? Thank you all in advance. Best, Antonio ___