Шаблон:Great circle distance/doc
Зоҳир
Usage
[вироиши манбаъ]Computes the great circle distance between two points, specified by the latitude and longitude, using the haversine formula.
{{Great circle distance|latitude 1|longitude 1|latitude 2|longitude 2|radius of the planet in km (optional)|units=(optional)}}
or
{{Great circle distance|lat1=|long1=|lat2=|long2=|r=|units=}}
latitude 1
,longitude 1
,latitude 2
, andlongitude 2
are the coordinates of your point. They should be specified as decimal degrees, not in degree-minute-second (DMS) notation, and South and West latitude and longitude should be expressed as negative numbers. You can use {{Decdeg}} to convert from DMS to decimal notation (e.g.{{Great circle distance|{{decdeg|40|42|45.72}}|{{decdeg|-70|0|21.24}}|{{decdeg|34|2|60}}|{{decdeg|-118|15|0}}|units=mi}}
yields 2,656).
- The
radius of the planet in km
(r=
) parameter defaults to 6373 km, which is the radius of the earth at 39 degrees from the equator. Because the earth is an ellipsoid, not a perfect sphere, the further your points are from this latitude the less accurate your answer will be. You can substitute this value for the radius at your midpoint, if known, or use any other value (for example, you could use 3390 if you want distances on Mars).
units
can be any unit recognized by Template:Convert.
Template Data
[вироиши манбаъ]Computes the great circle distance between two points, specified by the latitude and longitude, using the haversine formula.
Параметр | Тавзеҳот | Type | Status | |
---|---|---|---|---|
Latitude 1 | lat1 1 | Latitude of point 1 in decimal degrees
| Number | required |
Longitude 1 | long1 2 | Longitude of point 1 in decimal degrees
| Number | required |
Latitude 2 | lat2 3 | Latitude of point 2 in decimal degrees
| Number | required |
Longitude 2 | long2 4 | Longitude of point 2 in decimal degrees
| Number | required |
Radius | r 5 | Radius of the planet in kilometers
| Number | optional |
Units | units | Units to output distance in (defaults to km). Can be any distance unit supported by [[:Template:Convert]]
| String | optional |