% this function returns intercep time, critical distance % and crossover for headwave % input parameters: % p- ray parametr is scaler % h- layer thickness is array % v1- velocity of the upper layer(overburden layer) is array %return values %t_intercept- refraction intercept time %xcritical-critical distance %t0- normal incidence reflection time function [t_intercept xcritical t0]=one_layer(p,h,v1) angle=asin(p*v1); xcritical=sum(2*h.*tan(angle)); t_intercept=sum(2*h.*cos(angle)./v1); %refraction intercept time t0=sum(2*h./v1); end