<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi James,<br>
      <br>
      a hint: look how rotate/translate is implemented in :<br>
      <br>
      in cctbx_project/mmtbx/pdbtools.py<br>
      look for <br>
      def _rb_shift(..)<br>
      and then follow the code.<br>
      <br>
      This is just an example of a possible way of doing it. I guess
      there are many more.<br>
      <br>
      Pavel<br>
      <br>
      On 3/26/13 10:29 AM, James Stroud wrote:<br>
    </div>
    <blockquote
      cite="mid:6E0BB605-FFC0-46BC-A085-94391ECCF137@gmail.com"
      type="cite"><font class="Apple-style-span" size="4">Hello all,</font>
      <div><font class="Apple-style-span" size="4"><br>
        </font></div>
      <div><font class="Apple-style-span" size="4">I have a rotation +
          translation matrix. Let's say</font></div>
      <div><font class="Apple-style-span" size="4"><br>
        </font></div>
      <div>
        <div><font class="Apple-style-span" face="Monaco">py&gt; mtx</font></div>
        <div><font class="Apple-style-span" face="Monaco">array([[
            &nbsp;0.88302225, &nbsp; 0.11697778, &nbsp; 0.45451948, &nbsp; 5. ],</font></div>
        <div><font class="Apple-style-span" face="Monaco">&nbsp; &nbsp; &nbsp; &nbsp;[
            &nbsp;0.11697778, &nbsp; 0.88302225, &nbsp;-0.45451948, &nbsp;10. ],</font></div>
        <div><font class="Apple-style-span" face="Monaco">&nbsp; &nbsp; &nbsp; &nbsp;[
            -0.45451948, &nbsp; 0.45451948, &nbsp; 0.76604444, &nbsp;20. ],</font></div>
        <div><font class="Apple-style-span" face="Monaco">&nbsp; &nbsp; &nbsp; &nbsp;[ &nbsp;0. &nbsp;
            &nbsp; &nbsp; &nbsp;, &nbsp; 0. &nbsp; &nbsp; &nbsp; &nbsp;, &nbsp; 0. &nbsp; &nbsp; &nbsp; &nbsp;, &nbsp; 1. ]])</font></div>
        <div><font class="Apple-style-span" size="4"><br>
          </font></div>
        <div><font class="Apple-style-span" size="4">My usual way of
            transforming a set of coordinates with a 4x4 matrix is to
            use numpy:</font></div>
        <div><font class="Apple-style-span" size="4"><br>
          </font></div>
        <div><font class="Apple-style-span" face="Monaco">py&gt; xyz_1</font></div>
        <div><font class="Apple-style-span" face="Monaco">array([[ &nbsp;5.,
            &nbsp;10., &nbsp;15., &nbsp; 1.],</font></div>
        <div><font class="Apple-style-span" face="Monaco">&nbsp; &nbsp; &nbsp; &nbsp;[ 20.,
            &nbsp;15., &nbsp;10., &nbsp; 1.]])</font></div>
        <div><font class="Apple-style-span" face="Monaco"><br>
          </font></div>
        <div><font class="Apple-style-span" face="Monaco">
            <div>py&gt; numpy.inner(xyz_1, mtx)</div>
            <div>array([[ 17.40268126, &nbsp;12.59731919, &nbsp;33.76326397, &nbsp; 1.
              ],</div>
            <div>&nbsp; &nbsp; &nbsp; &nbsp;[ 28.9603065 , &nbsp;21.03969455, &nbsp;25.38784698, &nbsp; 1.
              ]])</div>
          </font></div>
      </div>
      <div><font class="Apple-style-span" size="4"><br>
        </font></div>
      <div><font class="Apple-style-span" size="4">What is the
          equivalent in cctbx? Is there a way to avoid converting
          coordinates back and fourth between numpy arrays with
          atoms().extract_xyz() &amp; .set_xyz() (as might be used from
          a iotbx_pdb_hierarchy_ext.root).</font></div>
      <div><font class="Apple-style-span" size="4"><br>
        </font></div>
      <div><font class="Apple-style-span" size="4">Thank you for any
          help.</font></div>
      <div><font class="Apple-style-span" size="4"><br>
        </font></div>
      <div><font class="Apple-style-span" size="4">James</font></div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
cctbxbb mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a>
<a class="moz-txt-link-freetext" href="http://phenix-online.org/mailman/listinfo/cctbxbb">http://phenix-online.org/mailman/listinfo/cctbxbb</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>