This is the Givens rotation method in Golub's "Matrix Computation". The c=cos(theta) is not always positive. By contrast, c=cos(theta) in Matlab's approach is always positive. But the results are still correct.
Reference: Golub and Van Loan, "Matrix Computation".
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.