c = @( a, b, alpha ) sqrt( a^2 + b^2 - 2 * a * b * cos( alpha ) );
c( 1, 1, pi/3 )
% ans = 1.000
c( 3, 4, pi/2 )
% ans = 5