The input to cosd and sind are in degrees, whereas it is in radians for cos and sin.
l = sind(alpha)*b; % the vertical leg
d = cosd(alpha)*b; % the horizontal leg
Given that b is the length of the hypotenuse, and that it is a right-angled triangle.
Hope it helped!
- Rob