English
Source / code snippets

Kürzeste distance and aeronautischer Startkurs between two Orten on the world

 

p.specht


Window Title "   KÜRZESTER NAUTISCHER STARTKURS (Erdkugel R = 6371.221 km)"
'Sphärische Geometrie - angeregt of ´User0815´ (CL) CopyLeft 2018-03 P.woodpecker, without Gewähr
Window Style 24:font 2:Declare lat0!,lon0!,lat1!,lon1!
var f!=pi()/180:var R! = 6371.221'km
:Proc ArcCos :Parameters w!:declare ac!:If w!=1:ac!=0:elseif w!=-1:ac!=pi()
else:ac!=Pi()/2-arctan(w!/Sqrt(1-Sqr(w!))):endif:return ac!:ENDPROC

Proc Startkurs :parameters lat0!,lon0!,lat1!,lon1!

    var cosg!=sin(lat0!)*sin(lat1!)+cos(lat0!)*cos(lat1!)*cos(lon1!-lon0!)
    return arccos(cosg!)

endproc

proc Dist :parameters lat0!,lon0!,lat1!,lon1!

    return R!*StartKurs(lat0!,lon0!,lat1!,lon1!)

endproc

Start:
Cls rgb(200+rnd(56),200+rnd(56),200+rnd(56))
print "\n\n     Coordinates the Ausgangspunktes"
print "\n Geogr.wide Phi° Äquator against north [+/-0...90, Lat.°]:",:input lat0!
print "\n Geogr.length (Lambda° Greenwich gg.West [+/-0..180, Lon.°]:",:input lon0!
print "\n\n     Coordinates the Zielpunktes"
print "\n                                  Breitengrad [Latitude °]:",:input lat1!
print "\n                                  Längengrad [Longitude °]:",:input lon1!
:if (lat0!=0) and (lon0!=0) and (lat1!=0) and (lon1!=0):font 0
:Print "\n\n SELBSTTEST: Leningrad -> SanFrancisco: Please Verify: 79.74°, 8867 km ???"
:lat0!=59.9:lon0!=-30.3:lat1!=37.8:lon1!=122.4:font 2:endif
lat0!=lat0!*f!:lon0!=lon0!*f!:lat1!=lat1!*f!:lon1!=lon1!*f!
Print "\n\n                     course with departure: ",\
Startkurs(lat0!,lon0!,lat1!,lon1!)/f!,"  °"
print   "\n                         Gesamtdistanz: ",\
Dist(lat0!,lon0!,lat1!,lon1!),"km"
waitinput:Goto "Start"
 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/27/21  
 




p.specht

Großkreisdistanzformel testing
======================
how far are the
* Nashville international Airport (BNA), Tennessee/USA with the Coordinates
36°7.2' Nördl.wide, 86°40.2' (in Dezimalgrad: 36.12, -86.67), and the
* Go Angeles international Airport (LAX), California/USA
33°56.4' n, 118°24.0' W (Dezimalgrad: 33.94, -118.40) in Luftlinie voneinander removes? (an Rosettacode-task).
Window Title "Großkreis-Distanzformel testen"
CLS:font 2
print "Großkreis-distance:",stature$("####.#############",\
GroßkreisDistanz(36.12,-86.67  ,  33.94,-118.4)),"km."
Waitinput' 2887.2599506071104 km
End

Proc ArcSin :Parameters Angle!:Declare Erg!

    If Abs(Angle!)=1:Erg!=Angle!*Pi()/2

        Else :Erg!=ArcTan(Angle!/Sqrt(1-Sqr(Angle!)))
        EndIf:Return Erg!

    ENDPROC

    Proc GroßkreisDistanz :Parameters n1!,e1! , n2!,e2!'Dezimalgrad

        var D2R!=ArcTan(1)/45:var diam!=2*6372.8:var Lg1m2!=(e1!-e2!)*D2R!
        var Lt1!=n1!*D2R!:var Lt2!=n2!*D2R!:var dz!=sin(Lt1!)-sin(Lt2!)
        var dx!=cos(Lg1m2!)*cos(Lt1!)-cos(Lt2!):var dy!=sin(Lg1m2!)*cos(Lt1!)
        var hDist!=ArcSin(Sqrt(sqr(dx!)+sqr(dy!)+sqr(dz!))/2)*diam!
        return hDist!

    Endproc

 
XProfan 11
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
05/29/21  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.664 Views

Untitledvor 0 min.
p.specht11/20/21
Uwe Lang11/20/21
Manfred Barei11/19/21
Wilfried Friebe11/17/21
More...

Themeninformationen

this Topic has 1 subscriber:

p.specht (2x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie