ó
¡¼™\c           @  s   d  d l  m Z d  d l m Z d  d l m Z m Z m Z d  d l m Z m Z m	 Z	 m
 Z
 m Z m Z d  d l m Z d  d l m Z d  d l m Z m Z m Z d  d l m Z d  d	 l m Z d  d
 l m Z d  d l m Z d e f d „  ƒ  YZ d S(   iÿÿÿÿ(   t   print_function(   t   Rational(   t   ret   imt	   conjugate(   t   sqrtt   sint   cost   acost   expt   ln(   t   trigsimp(   t	   integrate(   t   Matrixt   Addt   Mul(   t   sympify(   t
   SYMPY_INTS(   t   Expr(   t   Integert
   Quaternionc           B  s‘  e  Z d  Z d Z e Z d d d d e d „ Z e d „  ƒ Z	 e d „  ƒ Z
 e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d	 „  ƒ Z e d
 „  ƒ Z e d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e d „  ƒ Z d „  Z d „  Z  d „  Z! d „  Z" d „  Z# d „  Z$ d „  Z% d „  Z& d  „  Z' e d! „  ƒ Z( d" „  Z) d$ d# „ Z+ RS(%   sÇ  Provides basic quaternion operations.
    Quaternion objects can be instantiated as Quaternion(a, b, c, d)
    as in (a + b*i + c*j + d*k).

    Examples
    ========

    >>> from sympy.algebras.quaternion import Quaternion
    >>> q = Quaternion(1, 2, 3, 4)
    >>> q
    1 + 2*i + 3*j + 4*k

    Quaternions over complex fields can be defined as :

    >>> from sympy.algebras.quaternion import Quaternion
    >>> from sympy import symbols, I
    >>> x = symbols('x')
    >>> q1 = Quaternion(x, x**3, x, x**2, real_field = False)
    >>> q2 = Quaternion(3 + 4*I, 2 + 5*I, 0, 7 + 8*I, real_field = False)
    >>> q1
    x + x**3*i + x*j + x**2*k
    >>> q2
    (3 + 4*I) + (2 + 5*I)*i + 0*j + (7 + 8*I)*k
    g      &@i    c         C  s±   t  | ƒ } t  | ƒ } t  | ƒ } t  | ƒ } t d „  | | | | g Dƒ ƒ ra t d ƒ ‚ nL t j |  | | | | ƒ } | | _ | | _ | | _ | | _ | | _	 | Sd  S(   Nc         s  s   |  ] } | j  t k Vq d  S(   N(   t   is_commutativet   False(   t   .0t   i(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pys	   <genexpr>5   s    s    arguments have to be commutative(
   R   t   anyt
   ValueErrorR   t   __new__t   _at   _bt   _ct   _dt   _real_field(   t   clst   at   bt   ct   dt
   real_fieldt   obj(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR   /   s    "					c         C  s   |  j  S(   N(   R   (   t   self(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR"   @   s    c         C  s   |  j  S(   N(   R   (   R(   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR#   D   s    c         C  s   |  j  S(   N(   R   (   R(   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR$   H   s    c         C  s   |  j  S(   N(   R   (   R(   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR%   L   s    c         C  s   |  j  S(   N(   R    (   R(   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR&   O   s    c         C  s¸   | \ } } } t  | d | d | d ƒ } | | | | | | } } } t | t d d ƒ ƒ } t | t d d ƒ ƒ } | | }	 | | }
 | | } |  | |	 |
 | ƒ j ƒ  S(   sÛ  Returns a rotation quaternion given the axis and the angle of rotation.

        Parameters
        ==========

        vector : tuple of three numbers
            The vector representation of the given axis.
        angle : number
            The angle by which axis is rotated (in radians).

        Returns
        =======

        Quaternion
            The normalized rotation quaternion calculated from the given axis and the angle of rotation.

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import pi, sqrt
        >>> q = Quaternion.from_axis_angle((sqrt(3)/3, sqrt(3)/3, sqrt(3)/3), 2*pi/3)
        >>> q
        1/2 + 1/2*i + 1/2*j + 1/2*k
        i   i   (   R   R   R   R   t	   normalize(   R!   t   vectort   anglet   xt   yt   zt   normt   sR"   R#   R$   R%   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   from_axis_angleS   s      


c         C  s>  | j  ƒ  t d d ƒ } t | | d | d | d ƒ d } t | | d | d	 | d
 ƒ d } t | | d | d | d ƒ d } t | | d | d | d ƒ d } y^ t j | | d | d ƒ } t j | | d | d ƒ } t j | | d | d ƒ } Wn t k
 r*n Xt | | | | ƒ S(   s  Returns the equivalent quaternion of a matrix. The quaternion will be normalized
        only if the matrix is special orthogonal (orthogonal and det(M) = 1).

        Parameters
        ==========

        M : Matrix
            Input matrix to be converted to equivalent quaternion. M must be special
            orthogonal (orthogonal and det(M) = 1) for the quaternion to be normalized.

        Returns
        =======

        Quaternion
            The quaternion equivalent to given matrix.

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import Matrix, symbols, cos, sin, trigsimp
        >>> x = symbols('x')
        >>> M = Matrix([[cos(x), -sin(x), 0], [sin(x), cos(x), 0], [0, 0, 1]])
        >>> q = trigsimp(Quaternion.from_rotation_matrix(M))
        >>> q
        sqrt(2)*sqrt(cos(x) + 1)/2 + 0*i + 0*j + sqrt(2 - 2*cos(x))/2*k
        i   i   i    i   (   i    i    (   i   i   (   i   i   (   i    i    (   i   i   (   i   i   (   i    i    (   i   i   (   i   i   (   i    i    (   i   i   (   i   i   (   i   i   (   i   i   (   i    i   (   i   i    (   i   i    (   i    i   (   t   detR   R   R   t   _Quaternion__copysignt	   Exception(   R!   t   Mt   absQR"   R#   R$   R%   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   from_rotation_matrixy   s    (((("c         C  s)   | d k r d S|  | d k r$ |  S|  S(   Ni    (    (   R,   R-   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt
   __copysign¨   s    c         C  s   |  j  | ƒ S(   N(   t   add(   R(   t   other(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   __add__²   s    c         C  s   |  j  | ƒ S(   N(   R9   (   R(   R:   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   __radd__µ   s    c         C  s   |  j  | d ƒ S(   Niÿÿÿÿ(   R9   (   R(   R:   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   __sub__¸   s    c         C  s   |  j  |  | ƒ S(   N(   t   _generic_mul(   R(   R:   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   __mul__»   s    c         C  s   |  j  | |  ƒ S(   N(   R>   (   R(   R:   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   __rmul__¾   s    c         C  s   |  j  | ƒ S(   N(   t   pow(   R(   t   p(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   __pow__Á   s    c         C  s#   t  |  j |  j |  j |  j ƒ S(   N(   R   R   R   R   R%   (   R(   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   __neg__Ä   s    c         G  s   |  j  | Œ  S(   N(   R   (   R(   t   args(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   _eval_IntegralÇ   s    c         O  s?   | j  d t ƒ |  j g  |  j D] } | j | | Ž  ^ q  Œ  S(   Nt   evaluate(   t
   setdefaultt   Truet   funcRE   t   diff(   R(   t   symbolst   kwargsR"   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyRK   Ê   s    c         C  s×   |  } t  | ƒ } t | t ƒ sœ | j rv | j rf t t | ƒ | j t | ƒ | j | j	 | j
 ƒ St | | ƒ Sqœ t | j | | j | j	 | j
 ƒ Sn  t | j | j | j | j | j	 | j	 | j
 | j
 ƒ S(   sÖ  Adds quaternions.

        Parameters
        ==========

        other : Quaternion
            The quaternion to add to current (self) quaternion.

        Returns
        =======

        Quaternion
            The resultant quaternion after adding self to other

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import symbols
        >>> q1 = Quaternion(1, 2, 3, 4)
        >>> q2 = Quaternion(5, 6, 7, 8)
        >>> q1.add(q2)
        6 + 8*i + 10*j + 12*k
        >>> q1 + 5
        6 + 2*i + 3*j + 4*k
        >>> x = symbols('x', real = True)
        >>> q1.add(x)
        (x + 1) + 2*i + 3*j + 4*k

        Quaternions over complex fields :

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import I
        >>> q3 = Quaternion(3 + 4*I, 2 + 5*I, 0, 7 + 8*I, real_field = False)
        >>> q3.add(2 + 3*I)
        (5 + 7*I) + (2 + 5*I)*i + 0*j + (7 + 8*I)*k
        (   R   t
   isinstanceR   R&   t
   is_complexR   R"   R   R#   R$   R%   R   (   R(   R:   t   q1t   q2(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR9   Î   s    &		3&0c         C  s   |  j  |  | ƒ S(   s  Multiplies quaternions.

        Parameters
        ==========

        other : Quaternion or symbol
            The quaternion to multiply to current (self) quaternion.

        Returns
        =======

        Quaternion
            The resultant quaternion after multiplying self with other

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import symbols
        >>> q1 = Quaternion(1, 2, 3, 4)
        >>> q2 = Quaternion(5, 6, 7, 8)
        >>> q1.mul(q2)
        (-60) + 12*i + 30*j + 24*k
        >>> q1.mul(2)
        2 + 4*i + 6*j + 8*k
        >>> x = symbols('x', real = True)
        >>> q1.mul(x)
        x + 2*x*i + 3*x*j + 4*x*k

        Quaternions over complex fields :

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import I
        >>> q3 = Quaternion(3 + 4*I, 2 + 5*I, 0, 7 + 8*I, real_field = False)
        >>> q3.mul(2 + 3*I)
        (2 + 3*I)*(3 + 4*I) + (2 + 3*I)*(2 + 5*I)*i + 0*j + (2 + 3*I)*(7 + 8*I)*k
        (   R>   (   R(   R:   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   mul  s    &c         C  s1  t  |  ƒ }  t  | ƒ } t |  t ƒ r@ t | t ƒ r@ |  | St |  t ƒ sÆ | j r” |  j r„ | t t |  ƒ t |  ƒ d d ƒ St |  | ƒ SqÆ t |  | j |  | j	 |  | j
 |  | j ƒ Sn  t | t ƒ sL|  j r| j r
|  t t | ƒ t | ƒ d d ƒ St |  | ƒ SqLt | |  j | |  j	 | |  j
 | |  j ƒ Sn  t |  j	 | j	 |  j
 | j
 |  j | j |  j | j |  j	 | j |  j
 | j |  j | j
 |  j | j	 |  j	 | j |  j
 | j |  j | j	 |  j | j
 |  j	 | j
 |  j
 | j	 |  j | j |  j | j ƒ S(   s¹  Generic multiplication.

        Parameters
        ==========

        q1 : Quaternion or symbol
        q2 : Quaternion or symbol

        It's important to note that if neither q1 nor q2 is a Quaternion,
        this function simply returns q1 * q2.

        Returns
        =======

        Quaternion
            The resultant quaternion after multiplying q1 and q2

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import symbols
        >>> q1 = Quaternion(1, 2, 3, 4)
        >>> q2 = Quaternion(5, 6, 7, 8)
        >>> Quaternion._generic_mul(q1, q2)
        (-60) + 12*i + 30*j + 24*k
        >>> Quaternion._generic_mul(q1, 2)
        2 + 4*i + 6*j + 8*k
        >>> x = symbols('x', real = True)
        >>> Quaternion._generic_mul(q1, x)
        x + 2*x*i + 3*x*j + 4*x*k

        Quaternions over complex fields :

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import I
        >>> q3 = Quaternion(3 + 4*I, 2 + 5*I, 0, 7 + 8*I, real_field = False)
        >>> Quaternion._generic_mul(q3, 2 + 3*I)
        (2 + 3*I)*(3 + 4*I) + (2 + 3*I)*(2 + 5*I)*i + 0*j + (2 + 3*I)*(7 + 8*I)*k
        i    (   R   RN   R   R&   RO   R   R   R   R"   R#   R$   R%   (   RP   RQ   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR>   -  s(    * 		#2		#2;78c         C  s(   |  } t  | j | j | j | j ƒ S(   s(   Returns the conjugate of the quaternion.(   R   R"   R#   R$   R%   (   R(   t   q(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   _eval_conjugatex  s    c         C  s>   |  } t  t | j d | j d | j d | j d ƒ ƒ S(   s#   Returns the norm of the quaternion.i   (   R   R   R"   R#   R$   R%   (   R(   RS   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR/   }  s    c         C  s   |  } | d | j  ƒ  S(   s.   Returns the normalized form of the quaternion.i   (   R/   (   R(   RS   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR)   „  s    c         C  s=   |  } | j  ƒ  s! t d ƒ ‚ n  t | ƒ d | j  ƒ  d S(   s&   Returns the inverse of the quaternion.s6   Cannot compute inverse for a quaternion with zero normi   i   (   R/   R   R   (   R(   RS   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   inverse‰  s    c         C  s    |  } | d k r | j  ƒ  Sd } | d k  rE | j  ƒ  | } } n  t | t t f ƒ s^ t Sx; | d k r› | d @r„ | | } n  | d ?} | | } qa W| S(   sþ  Finds the pth power of the quaternion.

        Parameters
        ==========

        p : int
            Power to be applied on quaternion.

        Returns
        =======

        Quaternion
            Returns the p-th power of the current quaternion.
            Returns the inverse if p = -1.

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> q = Quaternion(1, 2, 3, 4)
        >>> q.pow(4)
        668 + (-224)*i + (-336)*j + (-448)*k
        iÿÿÿÿi   i    (   RU   RN   R   R   t   NotImplemented(   R(   RB   RS   t   res(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyRA     s    


c         C  sÇ   |  } t  | j d | j d | j d ƒ } t | j ƒ t | ƒ } t | j ƒ t | ƒ | j | } t | j ƒ t | ƒ | j | } t | j ƒ t | ƒ | j | } t | | | | ƒ S(   s·  Returns the exponential of q (e^q).

        Returns
        =======

        Quaternion
            Exponential of q (e^q).

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> q = Quaternion(1, 2, 3, 4)
        >>> q.exp()
        E*cos(sqrt(29))
        + 2*sqrt(29)*E*sin(sqrt(29))/29*i
        + 3*sqrt(29)*E*sin(sqrt(29))/29*j
        + 4*sqrt(29)*E*sin(sqrt(29))/29*k
        i   (	   R   R#   R$   R%   R	   R"   R   R   R   (   R(   RS   t   vector_normR"   R#   R$   R%   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR	   ¼  s    )$$$c         C  s´   |  } t  | j d | j d | j d ƒ } | j ƒ  } t | ƒ } | j t | j | ƒ | } | j t | j | ƒ | } | j t | j | ƒ | } t | | | | ƒ S(   sx  Returns the natural logarithm of the quaternion (_ln(q)).

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> q = Quaternion(1, 2, 3, 4)
        >>> q._ln()
        log(sqrt(30))
        + 2*sqrt(29)*acos(sqrt(30)/30)/29*i
        + 3*sqrt(29)*acos(sqrt(30)/30)/29*j
        + 4*sqrt(29)*acos(sqrt(30)/30)/29*k
        i   (	   R   R#   R$   R%   R/   R
   R   R"   R   (   R(   RS   RX   t   q_normR"   R#   R$   R%   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   _lnÚ  s    )c         C  s@   |  } | j  ƒ  \ } } t j | | | ƒ } | | j ƒ  | S(   sl  Computes the pth power in the cos-sin form.

        Parameters
        ==========

        p : int
            Power to be applied on quaternion.

        Returns
        =======

        Quaternion
            The p-th power in the cos-sin form.

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> q = Quaternion(1, 2, 3, 4)
        >>> q.pow_cos_sin(4)
        900*cos(4*acos(sqrt(30)/30))
        + 1800*sqrt(29)*sin(4*acos(sqrt(30)/30))/29*i
        + 2700*sqrt(29)*sin(4*acos(sqrt(30)/30))/29*j
        + 3600*sqrt(29)*sin(4*acos(sqrt(30)/30))/29*k
        (   t   to_axis_angleR   R1   R/   (   R(   RB   RS   t   vR+   RQ   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   pow_cos_sinó  s    c         G  sC   t  t |  j | Œ t |  j | Œ t |  j | Œ t |  j | Œ ƒ S(   N(   R   R   R"   R#   R$   R%   (   R(   RE   (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR     s    !c         C  s}   t  | t ƒ r, t j | d | d ƒ } n | j ƒ  } | t d |  d |  d |  d ƒ t | ƒ } | j | j | j f S(   s¢  Returns the coordinates of the point pin(a 3 tuple) after rotation.

        Parameters
        ==========

        pin : tuple
            A 3-element tuple of coordinates of a point. This point will be
            the axis of rotation.
        r
            Angle to be rotated.

        Returns
        =======

        tuple
            The coordinates of the quaternion after rotation.

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import symbols, trigsimp, cos, sin
        >>> x = symbols('x')
        >>> q = Quaternion(cos(x/2), 0, 0, sin(x/2))
        >>> trigsimp(Quaternion.rotate_point((1, 1, 1), q))
        (sqrt(2)*cos(x + pi/4), sqrt(2)*sin(x + pi/4), 1)
        >>> (axis, angle) = q.to_axis_angle()
        >>> trigsimp(Quaternion.rotate_point((1, 1, 1), (axis, angle)))
        (sqrt(2)*cos(x + pi/4), sqrt(2)*sin(x + pi/4), 1)
        i    i   i   (	   RN   t   tupleR   R1   R)   R   R#   R$   R%   (   t   pint   rRS   t   pout(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   rotate_point  s
     /c   	      C  sÑ   |  } y  | j  d k  r% | d } n  Wn t k
 r9 n X| j ƒ  } t d t | j  ƒ ƒ } t d | j  | j  ƒ } t | j | ƒ } t | j | ƒ } t | j | ƒ } | | | f } | | f } | S(   s¤  Returns the axis and angle of rotation of a quaternion

        Returns
        =======

        tuple
            Tuple of (axis, angle)

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> q = Quaternion(1, 1, 1, 1)
        >>> (axis, angle) = q.to_axis_angle()
        >>> axis
        (sqrt(3)/3, sqrt(3)/3, sqrt(3)/3)
        >>> angle
        2*pi/3
        i    iÿÿÿÿi   i   (	   R"   t   BaseExceptionR)   R   R   R   R#   R$   R%   (	   R(   RS   R+   R0   R,   R-   R.   R\   t   t(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR[   C  s    c         C  sa  |  } | j  ƒ  d } d d | | j d | j d } d | | j | j | j | j } d | | j | j | j | j } d | | j | j | j | j } d d | | j d | j d } d | | j | j | j | j }	 d | | j | j | j | j }
 d | | j | j | j | j } d d | | j d | j d } | sšt | | | g | | |	 g |
 | | g g ƒ S| \ } } } | | | | | | | } | | | | | | |	 } | | |
 | | | | } d } } } d } t | | | | g | | |	 | g |
 | | | g | | | | g g ƒ Sd S(   sí  Returns the equivalent rotation transformation matrix of the quaternion
        which represents rotation about the origin if v is not passed.

        Parameters
        ==========

        v : tuple or None
            Default value: None

        Returns
        =======

        tuple
            Returns the equivalent rotation transformation matrix of the quaternion
            which represents rotation about the origin if v is not passed.

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import symbols, trigsimp, cos, sin
        >>> x = symbols('x')
        >>> q = Quaternion(cos(x/2), 0, 0, sin(x/2))
        >>> trigsimp(q.to_rotation_matrix())
        Matrix([
        [cos(x), -sin(x), 0],
        [sin(x),  cos(x), 0],
        [     0,       0, 1]])

        Generates a 4x4 transformation matrix (used for rotation about a point
        other than the origin) if the point(v) is passed as an argument.

        Examples
        ========

        >>> from sympy.algebras.quaternion import Quaternion
        >>> from sympy import symbols, trigsimp, cos, sin
        >>> x = symbols('x')
        >>> q = Quaternion(cos(x/2), 0, 0, sin(x/2))
        >>> trigsimp(q.to_rotation_matrix((1, 1, 1)))
         Matrix([
        [cos(x), -sin(x), 0,  sin(x) - cos(x) + 1],
        [sin(x),  cos(x), 0, -sin(x) - cos(x) + 1],
        [     0,       0, 1,                    0],
        [     0,       0, 0,                    1]])
        iþÿÿÿi   i   i    N(   R/   R$   R%   R#   R"   R   (   R(   R\   RS   R0   t   m00t   m01t   m02t   m10t   m11t   m12t   m20t   m21t   m22R,   R-   R.   t   m03t   m13t   m23t   m30t   m31t   m32t   m33(    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   to_rotation_matrixp  s*    0$&&&$&&&$.!N(,   t   __name__t
   __module__t   __doc__t   _op_priorityR   R   RI   R   t   propertyR"   R#   R$   R%   R&   t   classmethodR1   R7   t   staticmethodR3   R;   R<   R=   R?   R@   RC   RD   RF   RK   R9   RR   R>   RT   R/   R)   RU   RA   R	   RZ   R]   R   Rb   R[   t   NoneRu   (    (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyR      sH   &/
										7	(K					,			"	)	-N(   t
   __future__R    t   sympyR   R   R   R   R   R   R   R   R	   R
   R   R   R   R   R   R   t   sympy.core.compatibilityR   t   sympy.core.exprR   t   sympy.core.numbersR   R   (    (    (    s8   lib/python2.7/site-packages/sympy/algebras/quaternion.pyt   <module>   s   .