polar2xy               package:ecolitk               R Documentation

_F_u_n_c_t_i_o_n_s _t_o _p_e_r_f_o_r_m _p_o_l_a_r _c_o_o_r_d_i_n_a_t_e _r_e_l_a_t_e_d _f_u_n_c_t_i_o_n_s

_D_e_s_c_r_i_p_t_i_o_n:

     Functions to perform polar coordinate related functions

_U_s_a_g_e:

     polar2xy(rho, theta)
     xy2polar(x, y)
     rotate(x, y, alpha)

_A_r_g_u_m_e_n_t_s:

       x: cartesian coordinate 

       y: cartesian coordinate  

     rho: polar radius 'rho' 

   theta: polar angle 'theta'

   alpha: angle to perform rotation 

_D_e_t_a_i_l_s:

     'y' and 'theta' can be respectively missing. In this case, 'x' and
     'rho' are expected to be lists with entries 'x, y', 'rho, theta'
     respectively.

_E_x_a_m_p_l_e_s:

     n <- 40
     nn <- 2
     thetas <- seq(0, nn * 2 * pi, length=n)

     rhos <- seq(1, n) / n

     plot(c(-1, 1), c(-1, 1), type="n")
     abline(h=0, col="grey")
     abline(v=0, col="grey")

     xy <- polar2xy(rhos, thetas)

     points(xy$x, xy$y, col=rainbow(n))

