<div>FYI, for anyone inclined to write their own programs, there is a similar Python function for this in CCTBX:</div><div><br></div><div>from mmtbx.refinement.fit_rotamers import rotate_point_around_axis</div><div>xyz_new = rotate_point_around_axis(axis_start, axis_end, xyz, angle_degrees)</div>

<div><br></div><div>I&#39;m not posting the code here because Paul&#39;s version is clearer, but it&#39;s in $PHENIX/cctbx_project/mmtbx/refinement/fit_rotamers.py.  (It wouldn&#39;t surprise me if this duplicates a more general function in one of the lower-level math modules, but I&#39;m not sure where to look.)</div>

<div><br></div><div>-Nat</div><div><br></div>On Wed, May 25, 2011 at 12:11 PM, Paul Emsley <span dir="ltr">&lt;<a href="mailto:paul.emsley@bioch.ox.ac.uk">paul.emsley@bioch.ox.ac.uk</a>&gt;</span> wrote:<br><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On 25/05/11 19:41, Hena Dutta wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Dear Members,<div class="im"><br>
<br>
<br>
I want to know the mathematical relations between 2 sets of co-ordinates, one before and one after the rotation. I used COOT to rotate the side chain (containing atoms N1, C2, N3,  C4, C5, C6, N6, N7 and C8) of Adenine by 180 degree about the glycosidic bond (C1’-N9). How the initial co-ordinates (Xi, Yi, Zi) and final co-ordinates (Xf, Yf, Zf) are mathematically related? I shall be very grateful if someone can tell me the equations.<br>


<br>
<br>
</div></blockquote>
<br>
I got it from the matrix from the Amore documentation.<br>
<br>
Coord_orth<br>
rotate_round_vector(direction, // vector of the bond about which we are rotating<br>
                                position,  // of the moving atom<br>
                                origin_shift, // typically the position of the B atom (e.g. N9)<br>
                                angle) {<br>
<br>
    unit_vec = direction.unit();<br>
<br>
   l = unit_vec[0];<br>
   m = unit_vec[1];<br>
   n = unit_vec[2];<br>
<br>
   ll = l*l;<br>
   mm = m*m;<br>
   nn = n*n;<br>
   cosk = cos(angle);<br>
   sink = sin(angle);<br>
   I_cosk = 1.0 - cosk;<br>
<br>
   // The Rotation matrix angle w about vector with direction cosines l,m,n.<br>
   //<br>
   // ( l**2+(m**2+n**2)cos k     lm(1-cos k)-nsin k        nl(1-cos k)+msin k   )<br>
   // ( lm(1-cos k)+nsin k        m**2+(l**2+n**2)cos k     mn(1-cos k)-lsin k   )<br>
   // ( nl(1-cos k)-msin k        mn(1-cos k)+lsin k        n*2+(l**2+m**2)cos k )<br>
   //<br>
   //  Thanks for that pointer EJD :).<br>
<br>
<br>
<br>
  Paul.<br>
<br>
<br>
<br>
_______________________________________________<br>
phenixbb mailing list<br>
<a href="mailto:phenixbb@phenix-online.org" target="_blank">phenixbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/phenixbb" target="_blank">http://phenix-online.org/mailman/listinfo/phenixbb</a><br>
</blockquote></div><br>