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.

_V_a_l_u_e:

_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))

