# How to apply Givens rotation to a matrix with complex elements? [duplicate]

I am trying to apply Givens rotation to a matrix, I could do it when the matrix had real values. For example, for this matrix:
$$A=\begin{bmatrix}3&5\\4&1\end{bmatrix}$$
I can simply calculate $$sin$$ and $$cos$$ like this:
$$r=\sqrt{3^2+4^2}=5$$
$$cos=3/r=0.6, sin=4/r=0.8$$
But when the values are complex numbers, I have a problem in determining which value of $$r$$ to select. For example: $$A=\begin{bmatrix}3+1.5i&5-7i\\4-2i&1+3i\end{bmatrix}$$
$$r=((3+1.5i)^2+(4-2i)^2)^{0.5}=4.403-0.795i$$ or $$-4.403+0.795i$$
So the question is, Which value of $$r$$ should I select? What is the criteria?

• @BrianBorchers Unfortunately no, it may be a close question, but there is no satisfactory answer. Commented Mar 26, 2020 at 21:41
• The second answer to that question gives fairly explicit instructions on how to do the complex Givens rotation. Commented Mar 26, 2020 at 21:48
• @BrianBorchers I will inspect it and see. Commented Mar 26, 2020 at 21:53
• @BrianBorchers I think you are right, it actually solves it. Commented Mar 26, 2020 at 22:20