Changeset 125 for trunk/SRC/Interpolation/ll_narcs_distances.pro
- Timestamp:
- 07/06/06 16:10:25 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/ll_narcs_distances.pro
r121 r125 3 3 ; @file_comments 4 4 ; This function returns the longitude and latitude [lon, lat] of 5 ;a point a given arc distance (-pi <= Arc_Dist <= pi), and azimuth (Az), 6 ;from a specified location Lon0, lat0. 7 ; Same as LL_ARC_DISTANCE but for n points without do loop. 5 ; a point a given arc distance (-pi <= Arc_Dist <= pi), and azimuth (Az), 6 ; from a specified location Lon0, lat0. 7 ; Same as LL_ARC_DISTANCE but for n points without do loop. 8 ; 9 ; Formula from Map Projections - a working manual. USGS paper 10 ; 1395. Equations (5-5) and (5-6). 8 11 ; 9 12 ; @categories Mapping, geography 10 13 ; 11 ; @param Lon0 {in}{required} An array containing the longitude of the starting point. 12 ; Values are assumed to be in radians unless the keyword 13 ; DEGREES is set. 14 ; @param Lat0 {in}{required} An array containing the latitude of the starting point. 15 ; Values are assumed to be in radians unless the keyword 16 ; DEGREES is set. 17 ; @param Arc_Dist {in}{required} The arc distance from Lon_lat0. The value must be between 14 ; @param Lon0 {in}{required} 15 ; An array containing the longitude of the starting point. 16 ; Values are assumed to be in radians unless the keyword DEGREES is set. 17 ; 18 ; @param Lat0 {in}{required} 19 ; An array containing the latitude of the starting point. 20 ; Values are assumed to be in radians unless the keyword DEGREES is set. 21 ; 22 ; @param Arc_Dist {in}{required} 23 ; The arc distance from Lon_lat0. The value must be between 18 24 ; -!PI and +!PI. To express distances in arc units, divide 19 25 ; by the radius of the globe expressed in the original units. 20 26 ; For example, if the radius of the earth is 6371 km, divide 21 ; the distance in km by 6371 to obtain the arc distance. 22 ; @param Az {in}{required} The azimuth from Lon_lat0. The value is assumed to be in 23 ; radians unless the keyword DEGREES is set. 27 ; the distance in km by 6371 to obtain the arc distance. 24 28 ; 25 ; @keyword DEGREES Set this keyword to express all measurements and 26 ; results in degrees. 29 ; @param Az {in}{required} 30 ; The azimuth from Lon_lat0. The value is assumed to be in 31 ; radians unless the keyword DEGREES is set. 32 ; 33 ; @keyword DEGREES 34 ; Set this keyword to express all measurements and results in degrees. 27 35 ; 28 36 ; @returns 29 ; a (2, n) array containing the 30 ; longitude / latitude of the resultings points. Values are in radians 31 ; unless the keyword DEGREES is set. 37 ; a (2, n) array containing the longitude/latitude of the resultings points. 38 ; Values are in radians unless the keyword DEGREES is set. 32 39 ; 33 ; @file_comments 34 ;Formula from Map Projections - a working manual. USGS paper 35 ;1395. Equations (5-5) and (5-6). 36 ; 37 ; @examples 40 ; @examples 38 41 ; IDL> Lon_lat0 = [1.0, 2.0]; Initial point specified in radians 39 42 ; IDL> Arc_Dist = 2.0; Arc distance in radians … … 43 46 ; 2.91415 -0.622234 44 47 ; 45 ; IDL> lon0 = [-10, 20, 100]46 ; IDL> lat0 = [0, -10, 45]47 ; IDL> lon1 = [10, 60, 280]48 ; IDL> lat1 = [0, 10, 45]49 ; IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi, /two_by_two)50 ; IDL> earthradius = 6378206.4d051 ; IDL> res = ll_narcs_distances(lon0, lat0, dist/earthradius, azi, /degrees)52 ; IDL> print, reform(res[0, *])48 ; IDL> lon0 = [-10, 20, 100] 49 ; IDL> lat0 = [0, -10, 45] 50 ; IDL> lon1 = [10, 60, 280] 51 ; IDL> lat1 = [0, 10, 45] 52 ; IDL> dist = map_npoints(lon0, lat0, lon1, lat1, azimuth = azi, /two_by_two) 53 ; IDL> earthradius = 6378206.4d0 54 ; IDL> res = ll_narcs_distances(lon0, lat0, dist/earthradius, azi, /degrees) 55 ; IDL> print, reform(res[0, *]) 53 56 ; 10.000000 60.000000 280.00000 54 ; IDL> print, reform(res[1, *])55 ; 1.1999280e-15 10.000000 45.00000057 ; IDL> print, reform(res[1, *]) 58 ; 1.1999280e-15 10.000000 45.000000 56 59 ; 57 60 ; @history … … 62 65 ; @version $Id$ 63 66 ; 64 ;-65 66 ;+67 ; @file_comments Return the [lon, lat] of the point a given arc distance68 ;(-pi <= arc_dist <= pi),69 ; and azimuth (az), from lon_lat0.70 67 ;- 71 68 ; … … 94 91 95 92 zero = where(arc_dist eq 0, count) 96 IF count NE 0 THEN BEGIN 93 IF count NE 0 THEN BEGIN 97 94 lam[zero] = lon0[zero] 98 95 phi[zero] = lat0[zero] 99 ENDIF 96 ENDIF 100 97 101 98 if keyword_set(degs) then return, transpose([[lam], [phi]]) / s $ … … 103 100 104 101 end 105 106
Note: See TracChangeset
for help on using the changeset viewer.