4

Triange rule

Could anybody help me to draw the picture with TikZ + PGF?

10
  • 1
    Have you tried anything yet? If so you should add what you have done Jan 12 '16 at 12:47
  • This looks overly complicated. Sarrus' rule is more intuitive. Jan 12 '16 at 12:50
  • 2
    For me Sarrus' rule is overcomplicated) I found texample.net/tikz/examples/mnemonic-rule-for-matrix-determinant
    – Olga K
    Jan 12 '16 at 12:56
  • 1
    Welcome to TeX.SX! Long ago, I came to the conclusion that teaching such shortcuts for 3⨉3 matrices is simply a waste of time; these triangles are not easier to remember and to use than direct Laplace expansion. I myself use a personal version of Sarrus' rule, but I never teach it, because students will use it also for larger matrices, notwithstanding any warning the teacher can give.
    – egreg
    Jan 12 '16 at 12:57
  • 1
    @egreg Computing determinants by hand is in general waste of time :)
    – percusse
    Jan 12 '16 at 13:03
9

As suggested in the comments, it is best to use the TikZ matrix library.

\documentclass{article}
\usepackage[T1]{fontenc}% for guillemets
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
  \matrix[matrix of nodes,left delimiter=|,right delimiter=|,
  row sep=1em,column sep=1em,
  nodes={draw,fill,circle,inner sep=1pt},nodes in empty cells] (m) at (0,0) {
    & & \\
    & & \\
    & & \\
  };
  \draw (m-2-1) -- (m-3-2);
  \draw (m-1-1) -- (m-3-3);
  \draw (m-1-2) -- (m-2-3);
  %
  \draw (m-1-2) -- (m-3-1);
  \draw (m-1-3) -- (m-3-2);
  %
  \draw (m-2-1) -- (m-1-3);
  \draw (m-3-1) -- (m-2-3);

  \matrix[matrix of nodes,left delimiter=|,right delimiter=|,
  row sep=1em,column sep=1em,
  nodes={draw,fill,circle,inner sep=1pt},nodes in empty cells] (n) at (5em,0) {
    & & \\
    & & \\
    & & \\
  };
  \draw (n-2-3) -- (n-3-2);
  \draw (n-1-3) -- (n-3-1);
  \draw (n-1-2) -- (n-2-1);
  %
  \draw (n-1-2) -- (n-3-3);
  \draw (n-1-1) -- (n-3-2);
  %
  \draw (n-2-3) -- (n-1-1);
  \draw (n-3-3) -- (n-2-1);

  \node at (0.0em,-2em) {<<$+$>>};
  \node at (2.5em,0 |- m.base) {$,$};
  \node at (5.0em,-2em) {<<$-$>>};
\end{tikzpicture}
\end{document}

enter image description here

1
  • 1
    It's great, exactly Like I dreamed! So quickly, thank you.
    – Olga K
    Jan 12 '16 at 13:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.