module killwave_utils

use sep
use OW_parms_areal
implicit none

contains

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

real function degrad(fwd,theta) result(theta1)
	integer :: fwd
	real theta
		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
	integer type
		taperfn=(value-start)/(end-start)
		if (type.eq.2) then
			taperfn=sin(taperfn*pi/2)
		end if
	return
end function
end module
