Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Daniel Bodmer
VTOL TCM
Commits
7f1f8280
Commit
7f1f8280
authored
May 13, 2022
by
Daniel Bodmer
Browse files
Upload New File
parent
80db8ac3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
Code/inverseGC.m
Code/inverseGC.m
+78
-0
No files found.
Code/inverseGC.m
0 → 100644
View file @
7f1f8280
%**************************************************************************
% * Programmiersprache MATLAB
% * Dateiname: inverseGC.m
%
% * Kurs- und Distanzberechnung auf einem Grokreis
%
%
% ******************************** Inputs *********************************
% * lat1: Breitengrad des Startpunktes []
% * lon1: Lngengrad des Startpunktes []
% * lat2: Breitengrad des Endpunktes []
% * lon2: Lngengrad des Endpunktes []
%
%
% ******************************** Outputs ********************************
% * s_inv: Grokreisdistanz zwischen Start- und Endpunkt [m]
% * a12: Startkurs (rechtsweisender Kurs gegenber geograph. Nordpol,
% Uhrzeigersinn pos.) []
%
%
% * Einrichtung/Autoren: DLR-LY/F.Linke/B.Lhrs
% * Bearbeitungszustand: freigebenen
% * Version: 1.0
% * Datum: 10032013
% * Letzte nderung: Kommentare eingefgt
%**************************************************************************
%**************************************************************************
%****************************Copyright (C) 2011****************************
%************DLR Deutsches Zentrum fuer Luft- und Raumfahrt e.V.***********
%************************German Aerospace Center e.V. *********************
%********************Institut fuer Lufttransportsysteme/*******************
%******************Institute of Air Transportation Systems*****************
%***************Tel. +49 531 295 3801, Fax: +49 531 295 2979***************
%
% www.dlr.de/ly
% www.tu-harburg.de/ilt
%
%* These coded instructions, statements, and computer programs contain****
%* unpublished proprietary information of the German Aerospace Center*****
%* e.V. and are protected by the copyright law. They may not be***********
%* disclosed to third parties or copied or duplicated in any form,********
%* in whole or in part, without the prior written consent of the German***
%* Aerospace Center e.V.**************************************************
%**************************************************************************
function
[
s_inv
,
a12
]
=
inverseGC
(
lat1
,
lon1
,
lat2
,
lon2
)
% Konvertierung von Grad zu Rad
lat1
=
lat1
*
pi
/
180
;
lon1
=-
lon1
*
pi
/
180
;
lat2
=
lat2
*
pi
/
180
;
lon2
=-
lon2
*
pi
/
180
;
% Winkel zwischen Start- und Endpunkt
dist
=
2
*
asin
(
sqrt
((
sin
((
lat1
-
lat2
)/
2
))
^
2
+
...
cos
(
lat1
)
*
cos
(
lat2
)
*
(
sin
((
lon1
-
lon2
)/
2
))
^
2
));
% Umrechnung in Meter
s_inv
=
dist
*
180
/
pi
*
60.
/
0.0005399568
;
if
(
dist
<
1E-16
)
% Wenn Start und Endpunkt (numerisch) identisch
brg
=
0
;
% dann Kurs = 0
elseif
(
abs
(
cos
(
lat1
))
<
1E-16
)
% Wenn Startpunkt (numerisch) am Pol
brg
=
(
3
-
sin
(
lat1
))
*
pi
/
2
;
% liegt, kann man nur Richtung
% Sden/Norden
else
%sonst
brg
=
modcrs
(
atan2
(
sin
(
lon1
-
lon2
)
*
cos
(
lat2
),
cos
(
lat1
)
*
sin
(
lat2
)
...
-
sin
(
lat1
)
*
cos
(
lat2
)
*
cos
(
lon1
-
lon2
)));
end
a12
=
brg
*
180
/
pi
;
% Umrechnung in
% crs in Weterbereich 0<crs<=2*pi konvertieren
function
course
=
modcrs
(
crs
)
twopi
=
2
*
pi
;
course
=
twopi
-
mod
(
twopi
-
crs
,
twopi
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment