gzAzimuth              package:maptools              R Documentation

_F_i_n_d _a_z_i_m_u_t_h _f_o_r _g_e_o_g_r_a_p_h_i_c_a_l _c_o_o_r_d_i_n_a_t_e_s

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

     The function finds azimuth values for geographical coordinates
     given as decimal degrees from the 'from' coordinates to the 'to'
     coordinate. In function 'trackAzimuth', the azimuth values are
     found between successive rows of the input coordinate matrix.

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

     gzAzimuth(from, to, type = "snyder_sphere")
     trackAzimuth(track, type="snyder_sphere")

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

    from: a two column matrix of geographical coordinates given as
          decimal degrees (longitude first)

   track: a two column matrix of geographical coordinates given as
          decimal degrees (longitude first)

      to: a one row, two column matrix or two element vector of
          geographical coordinates given as decimal degrees (longitude
          first)

    type: default is '"snyder_sphere"', otherwise '"abdali"'; the
          results should be identical with slightly less trigonometry
          in '"abdali"'

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

     The azimuth is calculated on the sphere, using the formulae given
     by Snyder (1987, p. 30) and Abdali (1997, p. 17). The examples use
     data taken from Abdali (p. 17-18). There is a very interesting
     discussion of the centrality of azimuth-finding in the development
     of mathematics and mathematical geography in Abdali's paper. Among
     others, al-Khwarizmi was an important contributor. As Abdali puts
     it, "This is a veritable who's who of medieval science" (p. 3).

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

     values in decimal degrees - zero is North - of the azimuth from
     the 'from' coordinates to the 'to' coordinate.

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

     Roger Bivand, with contributions by Sebastian Luque

_R_e_f_e_r_e_n_c_e_s:

     Snyder JP (1987) Map projections - a working manual, USGS
     Professional Paper 1395; Abdali SK (1997) "The Correct Qibla",
     <URL: http://patriot.net/users/abdali/ftp/qibla.pdf>

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

     name <- c("Mecca", "Anchorage", "Washington")
     long <- c(39.823333, -149.883333, -77.0166667)
     lat <- c(21.423333, 61.2166667, 38.9)
     x <- cbind(long, lat)
     rownames(x) <- name
     crib <- c(-9.098363, 56.575960)
     r1 <- gzAzimuth(x[2:3,], x[1,])
     r1
     all.equal(r1, crib)
     r2 <- gzAzimuth(x[2:3,], x[1,], type="abdali")
     r2
     all.equal(r2, crib)
     trackAzimuth(x)

