Commit 2eeb8137 authored by Daniel Bodmer's avatar Daniel Bodmer
Browse files

Upload New File

parent 3446444f
%**************************************************************************
% * Programmiersprache MATLAB
% * Dateiname: directGC.m
%
% * solves direct problem of geodesics on a spherical earth (great circle)
%
% * Einrichtung/Autoren: DLR-LY/F.Linke
% * Bearbeitungszustand: freigegeben
% * Version: 1.0
% * Datum: 20012012
% * Letzte Änderung: metric input possible
%**************************************************************************
%**************************************************************************
%****************************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 [dctlat,dctlon] = directGC(lat1, lon1, tc, d)
%Compute latitude of point d from [lat1,lon1] on the tc bearing.
% d ist zurückgelegte Strecke über Grund für diesen Zeitschritt in [m]
% tc ist der zuvor berechnete Kurs zum neuen Wegpunkt --> heading Chi_k
lon1daniel = lon1*pi/180;
d=d*0.0005399568; % [Distanz in Winkelminuten]
d=d/60; % [Distanz in Grad]
d=d*pi/180; % [Distanz in Rad]
lat1=lat1*pi/180; % [Breitengrad in rad]
lon1=-lon1*pi/180; % [Längengrad in rad]
tc=tc*pi/180;
dctlat = asin(sin(lat1) * cos(d) + cos(lat1) * sin(d) * cos(tc));
%Compute longitude of point d from [lat1,lon1] on the tc bearing.
dlon = atan2(sin(tc) * sin(d) * cos(lat1), cos(d) - sin(lat1) * sin(dctlat));
dctlon = modlon(lon1 - dlon);
dctlonDANIEL = (lon1daniel + dlon)*180/pi;
dctlat=dctlat*180/pi;
dctlon=-dctlon*180/pi;
function mdlon=modlon(Lon)
% Return lon in range -pi<=lon<pi
mdlon = mod(Lon + pi, 2 * pi) - pi;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment