distAB               package:clim.pact               R Documentation

_D_i_s_t_a_n_c_e _b_e_t_w_e_e_n _t_w_o _p_o_i_n_t_s _o_n _E_a_r_t_h

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

     The function returns the distance between two points on Earth
     given by the lon-lat coordinates. The distance is computed using
     the formula: d = a * theta, and |x1|*|x2| * cos(theta) =
     inner-product(x1,x2).

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

     distAB(lon,lat,lons,lats,a=6.378e06)

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

     lon: Longitude of reference point (degrees East).

     lat: Latitude of reference point (degrees North).

    lons: Longitude of points of interest (vector) (degrees East).

    lats: Latitude of points of interest (vector) (degrees North).

       a: Radius of the Earth.

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

     A real value: units=meters.

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

     R.E. Benestad

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

     distAB(10,60,5,58)    # [1] 362802.3
     distAB(0,0,180,0)     # [1] 20037078
     distAB(0,90,0,-90)    # [1] 20037078

