O
S|Pc               @   s0   d  Z  d d l m Z m Z Gd   d  Z d S(   u   
The PolarPoint Class
i    (   u   sinu   cosc             B   s5   |  Ee  Z d  Z d d d  Z d   Z d   Z d S(   uğ   
    This class represents a 2D point in polar coordinates defined
    by its distance from the center of the reference system and
    an angle (in radians) from the positive x-axis.
    g        c             C   s   | |  _  | |  _ d S(   u§   
        specifies a polar point by a `rho` (`magnitude`), its
        distance from the origin, and `theta` (`argument`) its
        polar angle (in radians)
        N(   u   rhou   theta(   u   selfu   rhou   theta(    (    u   polar.pyu   __init__   s    	c             C   s*   |  j  t |  j  |  j  t |  j  f S(   ue   
        returns rectangular (Cartesian) coords of the PolarPoint
        as an (x, y) tuple
        (   u   rhou   cosu   thetau   sin(   u   self(    (    u   polar.pyu   rect   s    c             C   s   |  j    \ } } t | |  S(   u=   
        returns the polar point as a complex number
        (   u   rectu   complex(   u   selfu   realu   imag(    (    u   polar.pyu	   asComplex   s    N(   u   __name__u
   __module__u   __doc__u   __init__u   rectu	   asComplex(   u
   __locals__(    (    u   polar.pyu
   PolarPoint   s   
		u
   PolarPointN(   u   __doc__u   mathu   sinu   cosu
   PolarPoint(    (    (    u   polar.pyu   <module>   s   