2

The following MWE results in the Matrix shown in the picture. I would like the braces of the cos- and sin-functions in the first column not to touch each other. How can I achieve that? enter image description here

\documentclass{scrreprt}
\usepackage{amsmath}
\usepackage{array}

\begin{document
\begin{align}
^{V}\boldsymbol{T}_{L}=
\begin{pmatrix}
cos\left(\frac{\pi\delta_i}{180}\right) & -sin\left(\frac{\pi\delta_i}{180}\right)  & 0 \\
sin\right(\frac{\pi\delta_i}{180}\left) & cos\left(\frac{\pi\delta_i}{180}\right)   & 0 \\
0                            & 0                                   & 1 
\end{pmatrix}
\end{align}
\end{document}
Max
  • 438
  • 1
    the easiest thing to do is add just manually add a bit of space after the first row: ... \\[3pt]. be sure not to leave any space before the [3pt], or it will get printed instead of being interpreted as a space. (amsmath checks that.) – barbara beeton Oct 30 '15 at 21:58

2 Answers2

4

For such small fractions, I recommend just \bigl and \bigr, instead of \left and \right, which would choose \Big size that's too large. There's no need to cover all symbols in between.

You can increase the separation between rows with \\[1ex] or so.

Always use \sin and \cos for the functions; also I added bm that's recommended for \boldsymbol (and can be abbreviated in \bm). Also, I lowered the subscript by adding an empty superscript. The “prescript” is better preceded by {} (although in this case it wouldn't matter). Finally, don't use align for single equations.

\documentclass{scrreprt}
\usepackage{amsmath,bm}

\begin{document}

\begin{equation}
{}^{V}\boldsymbol{T}^{}_{L}=
\begin{pmatrix}
\cos\bigl(\frac{\pi\delta_i}{180}\bigr) & -\sin\bigl(\frac{\pi\delta_i}{180}\bigr)  & 0 \\[1ex]
\sin\bigl(\frac{\pi\delta_i}{180}\bigr) & \cos\bigl(\frac{\pi\delta_i}{180}\bigr)   & 0 \\[1ex]
0                                       & 0                                         & 1
\end{pmatrix}
\end{equation}

\end{document}

enter image description here

egreg
  • 1,121,712
  • Thank you for your efforts! But now I got a couple of new questions: 1. What does the bm-package do? 2. Why not use align for single equations? – Max Oct 30 '15 at 22:04
  • by the way: the empty superscript thing is awesome! – Max Oct 30 '15 at 22:04
  • 1
    @Max For the align question, spacing and semantics, see e.g. align vs equation – Torbjørn T. Oct 30 '15 at 22:08
  • 1
    @Max bm realizes \boldsymbol in a much better way. Vertical spacing is better with equation when a single formula is to be displayed. The empty superscript is an old trick that comes in handy several times: for instance if you have $a_{i}b_{i}^{2}$ the subscripts would be misaligned; with $a^{}_{}ib_{i}^{2}$ they are at the same level. – egreg Oct 30 '15 at 22:09
  • ok, thanks a lot guys. I will consider using equation.
    @egreg about the bm: Can I just load the package and it will not possibly destroy anything in my document? I'm very close to finishing my thesis and i don't want to mess anything up now.
    – Max Oct 30 '15 at 22:20
  • and another small question: would you suggest using \arctan or \tan^{-1}? – Max Oct 30 '15 at 22:26
  • 1
    @Max In this case it's better not to touch the code; you could make an experiment, if you have time. About \tan^{-1} I have a strong opinion: never. ;-) I know that it should be interpreted as the inverse function but there are two reasons why it's wrong: (1) the tangent function is not (globally) invertible; (2) \tan^2 had been used for more than a century before the ^{-1} notation for an inverse function came into use. Similarly the arcsine is the inverse function of a suitable restriction of the sine function, so \sin^{-1} is abusive too. – egreg Oct 30 '15 at 22:26
  • well, to face the problem of none-global-invertibility, i originally defined an atan2-function like the one matlab uses. But I was told that it doesn't matter and I should not mention it. But your argument is still valid and I will use \arctan so! – Max Oct 30 '15 at 22:53
2

Since you load the array package, there is another method for slightly increasing row height of the matrix automatically. You just add \renewcommand{\arraystretch}{1.2} within your environment to increase the height by about 20%. I agree with egreg on the rest of changes he made.

\documentclass{scrreprt}
\usepackage{amsmath,bm}
\usepackage{array}
\begin{document}

\begin{align}\renewcommand{\arraystretch}{1.2}
^{V}\boldsymbol{T}^{}_{L}=
\begin{pmatrix}
\cos\bigl(\frac{\pi\delta_i}{180}\bigr) & -\sin\bigl(\frac{\pi\delta_i}{180}\bigr) & 0 \\
\sin\bigl(\frac{\pi\delta_i}{180}\bigr) & \cos\bigl(\frac{\pi\delta_i}{180}\bigr)  & 0 \\
0                                       & 0                                        & 1 
\end{pmatrix}
\end{align}

\end{document}

enter image description here

AboAmmar
  • 46,352
  • 4
  • 58
  • 127