%function [mission,lat1,lon1] = qrouteRelative(lat0,lon0,rng5,rng6,azimuth,
%  drctn,rng1,rng2,rng3,rng4,depth,rpm,nGps,transittime)
%  lat0			reference latitude
%  lon0			reference longitude
%  rng5			offset from start
%  rng6			length of qroute
%  azimuth		azimuth of qroute
%  drctn		direction (along or cross)
%  rng1			trackline lead-in length (meters)
%  rng2			qroute width (meters)
%  rng3			trackline spacing 1 (meters)
%  rng4			trackline spacing 2 (meters)
%  depth		depth of survey
%  rpm			rpm of tailcone
%  nGps			GPS hits per trackline (-n,...-2,-1,0,1,2,...,n)
%				where negative values skip n legs between fixes
%  transittime  time to transit to first waypoint
function [mission,lat2,lon2] = qrouteRelative(lat0,lon0,rng5,rng6,azimuth,drctn, ...
	rng1,rng2,rng3,rng4,depth,rpm,nGps,transittime)

geoid = selectGeoid;
[lat1,lon1] = reckon('rh',lat0,lon0,rng5,azimuth,geoid);
[lat2,lon2] = reckon('rh',lat0,lon0,rng5+rng6,azimuth,geoid);
mission = qroute([lat1 lat2],[lon1 lon2],drctn,rng1,rng2,rng3,rng4,depth,rpm,...
	nGps,transittime);
if isempty(mission), return, end
str = strvcat('Keep this point for start of next Q Route section:',' ',...
	['  End latitude = ' lat2str(lat2) ' (' mynum2str(lat2) ')'], ...
	['  End longitude = ' lon2str(lon2) ' (' mynum2str(lon2) ')']);
uiwait(msgbox(str,'modal'));
	