Vorlage:Entfernung
(Unterschied zwischen Versionen)
Zeile 32: | Zeile 32: | ||
Entfernung: {{#expr:({{#expr:6378.137*acos(sin{{#var:bb1}}*sin{{#var:bb2}}+cos({{#var:bb1}})*cos{{#var:bb2}}*cos({{#var:ll2}}-{{#var:ll1}}))}}- 0.05) round 1}} km | Entfernung: {{#expr:({{#expr:6378.137*acos(sin{{#var:bb1}}*sin{{#var:bb2}}+cos({{#var:bb1}})*cos{{#var:bb2}}*cos({{#var:ll2}}-{{#var:ll1}}))}}- 0.05) round 1}} km | ||
− | </noinclude><includeonly>{{#vardefine:e|{{#geodistance:{{{1|}}}|{{{2|}}}|unit=km}}}}{{#vardefine:l|{{#LEN:{{#var:e}}}}}}{{#vardefine:ll|{{#expr:{{#var:l}}-3}}}}{{#expr:{{#replace:{{#sub:{{#var:e}}|0|{{#var:ll}}}}|,|.}} - 0.05) round 1}}</includeonly><!-- | + | </noinclude><includeonly>{{#vardefine:e|{{#geodistance:{{{1|}}}|{{{2|}}}|unit=km}}}}{{#vardefine:l|{{#LEN:{{#var:e}}}}}}{{#vardefine:ll|{{#expr:{{#var:l}}-3}}}}{{#expr:{{#replace:({{#sub:{{#var:e}}|0|{{#var:ll}}}}|,|.}} - 0.05) round 1}}</includeonly> |
+ | <!-- | ||
{{#vardefine:b1|{{#explode:{{{1|}}}|,|0}}}}{{#vardefine:l1|{{#explode:{{{1|}}}| |1}}}}{{#vardefine:bb1|{{#expr:{{#var:b1}}*pi/180}}}}{{#vardefine:ll1|{{#expr:{{#var:l1}}*pi/180}}}}{{#vardefine:b2|{{#explode:{{{2|}}}|,|0}}}}{{#vardefine:l2|{{#explode:{{{2|}}}| |1}}}}{{#vardefine:bb2|{{#expr:{{#var:b2}}*pi/180}}}}{{#vardefine:ll2|{{#expr:{{#var:l2}}*pi/180}}}}{{#expr:{{#expr:6378.137*acos(sin{{#var:bb1}}*sin{{#var:bb2}}+cos({{#var:bb1}})*cos{{#var:bb2}}*cos({{#var:ll2}}-{{#var:ll1}}))}} round 2}} | {{#vardefine:b1|{{#explode:{{{1|}}}|,|0}}}}{{#vardefine:l1|{{#explode:{{{1|}}}| |1}}}}{{#vardefine:bb1|{{#expr:{{#var:b1}}*pi/180}}}}{{#vardefine:ll1|{{#expr:{{#var:l1}}*pi/180}}}}{{#vardefine:b2|{{#explode:{{{2|}}}|,|0}}}}{{#vardefine:l2|{{#explode:{{{2|}}}| |1}}}}{{#vardefine:bb2|{{#expr:{{#var:b2}}*pi/180}}}}{{#vardefine:ll2|{{#expr:{{#var:l2}}*pi/180}}}}{{#expr:{{#expr:6378.137*acos(sin{{#var:bb1}}*sin{{#var:bb2}}+cos({{#var:bb1}})*cos{{#var:bb2}}*cos({{#var:ll2}}-{{#var:ll1}}))}} round 2}} | ||
--> | --> |
Version vom 26. März 2014, 22:29 Uhr
Input: Geokoordinate 1 {{{1}}} Geokoordinate 2 {{{2}}} Output: Entfernung=ARCCOS[ SIN(Breite1)*SIN(Breite2) + COS(Breite1)*COS(Breite2)*COS(Länge2-Länge1) ] * 6378,137
Beispiel: Geokoordinate 1: Linnich: 50.977773, 6.268931 (lat, lon) (breite,länge) Geokoordinate 2: Aachen: 50.7753455, 6.0838868
Linnich
Geo:
k1: }}50.7723425, 06.0772938
b1: 50.7723425
l1: 06.0772938
bb1:0.886144545575
ll1:0.106068786421
Aachen
k2: }}50.7499400, 06.0876100
b2: 50.7499400
l2: 06.0876100
bb2:0.88575354819
ll2:0.106248838077
geodistance
e: 2,59 km l: 7 ll: 4
2.5
Entfernung: 2.5 km