# Given a flight path given in latitudes and longitudes, how do I find another flight path that is parallel to the path given?

Given a flight route that is given in latitudes and longitudes, how do I find another route that is "parallel" to the route given (find a perpendicular line to each waypoint given)? I think the best way to do this is to transform the geographic coordinates to Cartesian and find the parallel route and then converted it back to geographic coordinates but I never get it right. I tried the following approach also but I am not 100% sure if this is correct and I never get the last point of the "parallel" flight path:

• Is this assuming the flight paths are on the same altitude? you want find the intersecting point?
– Mapperz
Commented Feb 26, 2014 at 16:13
• There are an infinite number of segments which are perpendicular to a route at a point, but how can a route be defined to be perpendicular to another route? Commented Feb 26, 2014 at 16:19
• It's just a spheroidal trig problem. I've solved buffer construction in both 'C' and Java. You just need a reliable function library to solve bearing and distance from two points, and new point from point, bearing and distance. After that it is just a construction exercise. Commented Feb 27, 2014 at 5:29
• It's not the points that are important, per se, it's the segments -- for each segment, calculate bearing and distance, then construct points 90 degrees (pi/2) offset (+/-) from that bearing. If your math is right, a simple parallel line is just the same bearing and distance from the new point. With spheriodal support code, there's no need to waste time with Cartesian conversion. Commented Feb 27, 2014 at 12:42
• perpendicular from origine? Commented Feb 27, 2014 at 15:19

## 2 Answers

Here's how to compute a parallel path. Initial path is Moscow to Sevastopol. First, I assume that the waypoints lie on a geodesic. So the perpendicular direction is found just by adding 90° to the azimuth of the geodsic. Next I treat the more general case where there may be changes in direction at the way points; for this I compute a mean direction at each way point and subtract (for the sake of variety) 90° from this. This uses my MATLAB package Geodesics on an ellipsoid of revolution:

``````lat1=55.41; lon1=37.91; % Moscow
lat2=44.68; lon2=33.58; % Sevastopol
nseg=10; % number of segments
t=50000; % offset

[s12,azi1,azi2] = geoddistance(lat1,lon1,lat2,lon2);
[lata,lona,azia] = geodreckon(lat1,lon1,[0:nseg]*s12/nseg,azi1);

% offset waypoints assuming original path is a geodesic
[latb,lonb] = geodreckon(lata,lona,t,azia+90);

% don't assume waypoints lie on a geodesic
[~,azix,aziy] = geoddistance(lata(1:end-1),lona(1:end-1),...
lata(2:end),lona(2:end));
dazi=azix(2:end)-aziy(1:end-1);
dazi=mod(dazi+180,360)-180;
% the average azimuth at the waypoints
azic=[azix(1),aziy(1:end-1)+dazi/2,aziy(end)];
% use sec to do a miter join
[latc,lonc] = geodreckon(lata,lona,t*secd([0,dazi/2,0]),azic-90);

plot(lona,lata, lonb,latb, lonc,latc);
``````

If you project (transform) to plane coords, do the coordinate geometry (cogo), and project back to geographic coords, you must first choose the right map projection to use. There are very many and each introduces some distortions.

Another option is to stay on the sphere, and perform spherical (or geodetic) coordinate geometry. Those are much more complex, but you eliminate having to choose a projection.

Consider using the GEOS - Geometry Engine, Open Source, the PROJ.4 - Cartographic Projections Library, and other libraries.