% Written by Joshua Simmons 20/01/16 to calculate angle for TN for SBeach % modelling purposes. % NOTE: this code assumes that the furthest offshore point (-10m) is the % x(end) and the furthest inshore point is in x(1) (in line with the xbeach % co-ordinate system) clear clc % load('D:\7 Erosion Models\a_nb_model_comparison\xbeach\other_data\narra_xyz_for_alfa.mat') % % for ii = 1:length(pfxy) % x = [pfxy(ii).x(1) pfxy(ii).x(end)]; % y = [pfxy(ii).y(1) pfxy(ii).y(end)]; % % if x(2)-x(1)>0 % intang = atand((y(2)-y(1))/(x(2)-x(1))); % ang = 90 - intang; % elseif x(2)-x(1)<0 % intang = atand((y(2)-y(1))/(x(2)-x(1))); % ang = 270 - intang; % end % TN(ii,1) = ang; % end %or else get information from site specific file addpath('J:\Coastal\') coastalinit % pfs = {'PF1','PF2','PF4','PF6','PF8'}; % pfs = {'PF1','PF2','PF3'}; pfs = {'PF1','PF2','PF3','PF4','PF5'}; for ii = 1:length(pfs) [~,rot_angle] = get_rotation_specs('DEEWH',pfs{ii}); alfa(ii,1) = -rot_angle*180/pi; end