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".
Steven Huang (2021). Givens rotation (https://www.mathworks.com/matlabcentral/fileexchange/8165-givens-rotation), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!