module killwave_utils

use sep

implicit none

contains

real function degtan(theta)
	real theta,pi
	pi=3.14159267
	degtan=tan(pi*theta/180)
	return
end function

real function degrad(fwd,theta) result(theta1)
	integer :: fwd
	real pi,theta
		pi=3.14159267
		if (fwd==-1)then
			theta1=pi*theta/180
		else
			theta1=theta*180/pi
		endif
	return
end function

real function taperfn(start,end,value,type)
	real start,end,value,pi
	integer type
		pi=3.14159267
		taperfn=(value-start)/(end-start)
		if (type.eq.2) then
			taperfn=sin(taperfn*pi/2)
		end if
	return
end function


end module