lattice                package:ssBase                R Documentation

_C_r_e_a_t_e_s _L_a_t_t_i_c_e _o_f _P_o_i_n_t_s _o_n _S_p_h_e_r_e _S_u_r_f_a_c_e

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

     A lattice of (2*J+1) by (2*K+1) grid points based on squares or
     equilateral triangles (at a fixed distance, d apart) is calculated
     centred on a specified point and with a given orientation. 

     The major axis of the lattice is taken along the great circle
     through the lattice centre in the direction specified by the
     orientation alpha.

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

     lattice(K, J, d, alpha, centrelat, centrelong, triangle=TRUE)

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

       K: the number of points stepped off to the left and to the right
          of the origin along the major axis. 

       J: the number of points stepped off in both directions
          orthogonal to the major axis. 

       d: the distance between the lattice points (in kilometres). 

   alpha: pi/2 minus 'alpha' gives the angle (in radians) between the
          local meridian through the lattice centre and the major axis
          of the lattice, where 'alpha' is between 0 and pi. 

centrelat: the latitude component of the centre (origin) of the grid. 

centrelong: the longitude component of the centre (origin) of the grid. 

triangle: logical. If 'TRUE', a triangular grid is calculated. If
          'FALSE', a square grid is calculated. 

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

     A lattice of (2*J+1) by (2*K+1) grid points based on equilateral
     triangles (at a fixed distance, d apart) or squares is calculated.
     The grid is rotated by the angle 'alpha'. The algorithm from
     'epi.circle' is subsequently used to convert to spherical
     coordinates, centred over the specified origin. The spherical
     coordinates (longitude, latitude) of the grid points are returned
     in a list.

_V_a_l_u_e:

     A list object is returned. It contains the following components:

centrelong: as specified above. 

centrelat: as specified above. 

       d: the distance between the lattice points (in kilometres). 

longitude: a vector giving the longitude of the grid points. 

latitude: a vector giving the latitude component of the grid points. 

       i: a vector of sequence numbers of the lattice points, starting
          from 1 in the south western corner. 

       j: a vector of grid coordinates along the major axis of the
          lattice, with 0 as the centre. 

       k: a vector of grid coordinates orthogonal to the major axis of
          the lattice, with 0 as the centre. 

_A_u_t_h_o_r(_s):

     Alistair Merrifield, 1998

_S_e_e _A_l_s_o:

     'lattice.retrieve'

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

     #   Creates a triangular lattice of 207 points centred over (175, -41)

     x <- lattice(J=4, K=11, d=120, alpha=pi/4, centrelat=-41, 
                  centrelong=175, triangle=TRUE)

     plot(x$longitude, x$latitude, xlab="Longitude", ylab="Latitude",
          main="Triangluar Arrangement")

     x <- lattice(J=4, K=11, d=120, alpha=pi/4, centrelat=-41, 
                  centrelong=175, triangle=FALSE)

     plot(x$longitude, x$latitude, xlab="Longitude", ylab="Latitude",
          main="Rectangular Arrangement")

