ó
j™xTc           @   sU   d  d l  m Z d  d l m Z e j Z d „  Z d „  Z e d k rQ e ƒ  n  d S(   iÿÿÿÿ(   t   division(   t   mathc         C   s:  |  d k s t  ‚ | d k s$ t  ‚ | d k s6 t  ‚ |  | | } | d k rT d S| t |  | ƒ k rƒ d t t |  | ƒ d S| } |  | k r¹ t d |  | d |  | d d S|  | k rÕ |  | } } n | |  } } t | d | d d | | d | d d | | d | | d | d d | S(   s;   http://mathworld.wolfram.com/Sphere-SphereIntersection.htmli    i   i   i   i   i   gUUUUUUõ?(   t   AssertionErrort   abst   pit   min(   t   radius_1t   radius_2t   distancet   rrdt   dt   Rt   r(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/sphere_sphere_intersection.pyt   volume   s    $c          C   sÀ  d d l  m }  t d d d ƒ d k s. t ‚ t d d d ƒ d k sL t ‚ |  t d d d ƒ d ƒ sm t ‚ |  t d d d ƒ d ƒ sŽ t ‚ |  t d d d ƒ d
 ƒ s¯ t ‚ |  t d d d ƒ d
 ƒ sÐ t ‚ |  t d d d ƒ d ƒ sñ t ‚ |  t d d d ƒ d ƒ st ‚ |  t d d d ƒ d ƒ s3t ‚ |  t d d d ƒ d ƒ sTt ‚ |  t d d d ƒ d ƒ sut ‚ |  t d d d ƒ d ƒ s–t ‚ |  t d d d ƒ d ƒ s·t ‚ d GHd  S(   Niÿÿÿÿ(   t   approx_equali    i   i   i   gFx-8RÁ@@g¦fD†Bk@g�íµ ÷Æ°>gÀlßü†Bk@i   g1^Œì¾¹W@gffffff@g333333Ó?g×£p=
×Ó?g•`l¹À@@g)\�Âõ(@g–ÅŠ]ü6?g333333@t   OKgƒÞC  @gƒÞC  @(   t   libtbx.test_utilsR   R   R   (   R   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/sphere_sphere_intersection.pyt   exercise   s    !!!!!!!!!!!t   __main__N(   t
   __future__R    t   stdlibR   R   R   R   t   __name__(    (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/scitbx/math/sphere_sphere_intersection.pyt   <module>   s   			