function [u,v] = polar2uv(dir,spd) % polar2uv: (east, north) currents of direction and speed % % u is eastward current component % v is northward current component % dir is compass direction of current % (90 for eastward flow, 270 for westward) % spd is magnitude of current % % Fran Hotchkiss, February 20, 1998. %%% START USGS BOILERPLATE -------------% There is no published documentation for these programs- use the % internal comments and help function. % Programs written in Matlab- as early as 7.2.0.232 (R2006a) and % most recent modifications in v7.8.0 (R2009a) % Programs ran on PC with Windows XP Professional OS, and RHEL4 linux. % % "Although this program has been used by the USGS, no warranty, % expressed or implied, is made by the USGS or the United States % Government as to the accuracy and functioning of the program % and related program material nor shall the fact of distribution % constitute any such warranty, and no responsibility is assumed % by the USGS in connection therewith." %%% END USGS BOILERPLATE -------------- dir = dir .* pi ./180.; [v,u] = pol2cart(dir,spd);