[Tex/LaTex] Fit an equation in a single column

equationsmath-mode

I am using the following code but the result obtained is not setting in the space (left column of the page). I have it on my page but it is overlapping the text on the right column of the page. How can I decrease the size of math equations or is there any other way I can make it settle in that particular space?

\Bigg(
\begin{tabular}{c}
$x_n$ \\
$y_n$ \\
$z_n$ 
\end{tabular} 
\Bigg)  = \Bigg( 
\begin{tabular}{ccc}
$\cos\theta\cos\psi$ & $-\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi$ & $\sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta$ \\

$\cos\theta\sin\psi$ & $\cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi$ & $\sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi$ \\

$\sin\theta$ & $cos\theta\sin\phi$ & $cos\theta\cos\phi$
\end{tabular}  \Bigg( \begin{tabular}{c}
$x_b$ \\
$y_b$ \\
$z_b$
\end{tabular} \Bigg)

Best Answer

It is best to divide this up into smaller elements, the 3x3 matrix is simply too big. Giving names to the columns and writing them out separately provides narrower text. Below I give two version, the first using the convenient amsmath package, the second with standard LaTeX commands. In the standard LaTeX version, note that array is appropriate in math mode, rather than tabular.

Sample output

\documentclass[twocolumn]{article}

\usepackage{amsmath}

\begin{document}

\begin{equation*}
  \begin{pmatrix}
    x_n \\
    y_n \\
    z_n
  \end{pmatrix}
  =
  \begin{pmatrix}    
    v_1& v_2& v_3
  \end{pmatrix}
  \begin{pmatrix}
    x_b \\
    y_b \\
    z_b
  \end{pmatrix}
  ,
\end{equation*}
where
\begin{gather*}
  v_1 =
  \begin{pmatrix}
    \cos\theta\cos\psi \\
    \cos\theta\sin\psi  \\
    \sin\theta
  \end{pmatrix}
  ,\\
  v_2 =
  \begin{pmatrix}
    -\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi\\
    \cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi\\
    \cos\theta\sin\phi
  \end{pmatrix}
  , \\
  v_3 = \begin{pmatrix}
    \sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta \\
    \sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi \\
    \cos\theta\cos\phi
  \end{pmatrix}.
\end{gather*}

Poorer version in standard LaTeX:
\begin{displaymath}
  \left(\begin{array}{c}
    x_n \\
    y_n \\
    z_n
  \end{array}\right)
  =
  \left(\begin{array}{ccc}    
    v_1& v_2& v_3
  \end{array}\right)
  \left(\begin{array}{c}
    x_b \\
    y_b \\
    z_b
  \end{array}\right)
  ,
\end{displaymath}
where
\begin{eqnarray}
  v_1 &=&
  \left(\begin{array}{c}
    \cos\theta\cos\psi \\
    \cos\theta\sin\psi  \\
    \sin\theta
  \end{array}\right)
  ,\nonumber \\
  v_2 &=&
  \left(\begin{array}{c}
    -\cos\phi\sin\psi +\sin\phi\sin\theta\cos\psi\\
    \cos\phi\cos\psi +\sin\phi\sin\theta\sin\psi\\
    \cos\theta\sin\phi
  \end{array}\right)
  ,\nonumber \\
  v_3 &=& \left(\begin{array}{c}
    \sin\phi\sin\psi +\cos\phi\cos\psi\sin\theta \\
    \sin\theta\sin\psi\cos\phi - \cos\psi\sin\phi \\
    \cos\theta\cos\phi
  \end{array}\right)
  \nonumber.
\end{eqnarray}

\end{document}

See the amsmath documentation for other math environments with differental alignment possibilities.