ó
ø™xTc           @   s=   d  d l  m Z d  d l m Z d  d l m Z d „  Z d S(   iÿÿÿÿ(   t   division(   t   matrix(   t&   r3_rotation_axis_and_angle_from_matrixc         C   s7  |  j  d d d d ƒ } |  j  d d d d ƒ } |  j  d d d d ƒ } t j | | | d ƒ j ƒ  } |  j  d d d d ƒ } |  j  d d d d ƒ } |  j  d d d d ƒ } t j | | | d ƒ j ƒ  } | | j ƒ  }	 t |	 ƒ }
 |  j ƒ  d } t j |
 j ƒ } | j	 | d t
 ƒ} | | j ƒ  | f S(	   s›   Given a cbf goniometer handle, first determine the real rotation
  axis, then determine the fixed component of rotation which is rotated
  about this axis.g        i   i    i   g      ð?t   deg(   i   i   (   i   i   (   t   rotate_vectorR   t   rect	   transposet   inverseR   t   get_rotation_ranget   colt   axist$   axis_and_angle_as_r3_rotation_matrixt   True(   t	   cbf_goniot   xt   yt   zt   Rt   x1t   y1t   z1t   R1t   RAt   rott   startR
   t   S(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/model/goniometer_helpers.pyt!   cbf_gonio_to_effective_axis_fixed   s      N(   t
   __future__R    t   scitbxR   t   scitbx.mathR   R   (    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/dxtbx/model/goniometer_helpers.pyt   <module>   s   
