RotationMatrix[θ, {0, 0, 1}] // Matrixform
gives
$\begin{pmatrix} \cos (\theta ) & -\sin (\theta ) & 0 \\ \sin (\theta ) & \cos (\theta ) & 0 \\ 0 & 0 & 1 \\ \end{pmatrix}$
Now, I would like to add a row and column to it like this
$\begin{pmatrix} \color{red}{1}&\color{red}{0}&\color{red}{0}&\color{red}{0}\\ \color{red}{0}& \cos (\theta ) & -\sin (\theta ) & 0 \\ \color{red}{0}&\sin (\theta ) & \cos (\theta ) & 0 \\ \color{red}{0}& 0 & 0 & 1 \\ \end{pmatrix}$
I would like to just be able to add red ones on any RotationMatrix[θ, w]
that I define as done in the beginning.
Is there a simple way to achieve this?
On a similar note,
RotationMatrix[I ϕ, {0, 0, 1}] // MatrixForm
gives
$\begin{pmatrix} \cosh (\phi ) & -i \sinh (\phi ) & 0 \\ i \sinh (\phi ) & \cosh (\phi ) & 0 \\ 0 & 0 & 1 \\ \end{pmatrix}$
So here I would like to add a row:
$\begin{pmatrix}\cosh \phi & -i\sinh \phi & 0 & \color{red}0 \\ i\sinh \phi & \cosh \phi & 0 & \color{red}0 \\ 0 & 0 & 1 & \color{red}0 \\ \color{red}0 & \color{red}0 & \color{red}0 & \color{red}1\end{pmatrix}$
And here also I would like to have the flexibility of defining the things in a black part about any vector. Any suggestions?
RotationMatrix[]
directly? Look at e.g.RotationMatrix[θ, IdentityMatrix[4][[{2, 3}]]]
andRotationMatrix[I ϕ, IdentityMatrix[4][[{1, 2}]]]
. (See this as well.) $\endgroup$