http://www.mathworks.com/matlabcentral/newsreader/view_thread/293452
MATLAB Central Newsreader  Rotations of points around points..
Feed for thread: Rotations of points around points..
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Fri, 08 Oct 2010 13:54:31 +0000
Rotations of points around points..
http://www.mathworks.com/matlabcentral/newsreader/view_thread/293452#786341
DRG
Hey folks  not sure if this is more a matlab or trig question, but<br>
basically I have a group of four points I wish to rotate around a<br>
point. The central point is (dt,zt). The four points relative to this<br>
are<br>
<br>
A: (dt + a, zt + b)<br>
B: (dt + a, zt  b)<br>
C: (dt  c, zt  d)<br>
D: (dt  c, zt + d)<br>
<br>
where a,b,c,d are constants.<br>
<br>
I could work it manually by manipulating the trig but I need to do it<br>
quite often in my code and need to have explicits values returned. Is<br>
there any quicker way to do this that anyone might know ?<br>
<br>
Thanks in advance!

Fri, 08 Oct 2010 20:44:04 +0000
Re: Rotations of points around points..
http://www.mathworks.com/matlabcentral/newsreader/view_thread/293452#786364
Roger Stafford
DRG <grimesd2@gmail.com> wrote in message <d6c8b25d65864d9c8f62143fe158a773@c10g2000yqh.googlegroups.com>...<br>
> Hey folks  not sure if this is more a matlab or trig question, but<br>
> basically I have a group of four points I wish to rotate around a<br>
> point. The central point is (dt,zt). The four points relative to this<br>
> are<br>
> <br>
> A: (dt + a, zt + b)<br>
> B: (dt + a, zt  b)<br>
> C: (dt  c, zt  d)<br>
> D: (dt  c, zt + d)<br>
> <br>
> where a,b,c,d are constants.<br>
> <br>
> I could work it manually by manipulating the trig but I need to do it<br>
> quite often in my code and need to have explicits values returned. Is<br>
> there any quicker way to do this that anyone might know ?<br>
> <br>
> Thanks in advance!<br>
        <br>
It is an elementary trigonometry problem but matlab is well equipped to solve it. I'll put in general terms. In the xy plane if a point at (x1,y1) is rotated counterclockwise by an angle 'a' about a point (x0,y0), then it will arrive at point (x2,y2) in accordance with the equations<br>
<br>
x2x0 = (x1x0)*cos(a)  (y1y0)*sin(a)<br>
y2y0 = (x1x0)*sin(a) + (y1y0)*cos(a)<br>
<br>
I'll let you take it from there.<br>
<br>
Roger Stafford