Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- documentclass[12pt]{article}
- usepackage{tikz}
- usetikzlibrary{matrix}
- usepackage{fullpage,amsmath}
- begin{document}
- begin{align*}
- begin{array}{|rrr|rr}
- i & j & k & i & j\
- 3 & -2 & 2 & 3 & -2\
- 3 & 2 & 1 & 3 & 2
- end{array}
- end{align*}
- begin{figure}[!htbp]
- tikzset{node style ge/.style={circle}}
- centering
- begin{tikzpicture}[baseline=(A.center)]
- tikzset{BarreStyle/.style = {opacity=.4,line width=3 mm,line cap=round,color=#1}}
- tikzset{SignePlus/.style = {above left,,opacity=0.8,circle,fill=#1!50}}
- tikzset{SigneMoins/.style = {above right,,opacity=0.8,circle,fill=#1!50}}
- % les matrices
- matrix (A) [matrix of math nodes, nodes = {node style ge},,column sep=0 mm]
- { i & j & k & i & j \
- 3 & -2 & 2 & 3 & -2 \
- 3 & 2 & 1 & 3 & 2 \
- };
- draw [BarreStyle=red] (A-1-1.north west) node[SignePlus=red] {$+$} to (A-3-3.south east) ;
- draw [BarreStyle=red] (A-1-2.north west) node[SignePlus=red] {$+$} to (A-3-4.south east) ;
- draw [BarreStyle=red] (A-1-3.north west) node[SignePlus=red] {$+$} to (A-3-5.south east) ;
- draw [BarreStyle=blue] (A-1-3.north east) node[SigneMoins=blue] {$-$} to (A-3-1.south west);
- draw [BarreStyle=blue] (A-1-4.north east) node[SigneMoins=blue] {$-$} to (A-3-2.south west);
- draw [BarreStyle=blue] (A-1-5.north east) node[SigneMoins=blue] {$-$} to (A-3-3.south west);
- draw (A-1-1.north west) -- (A-3-1.south west); draw (A-1-3.north east) -- (A-3-3.south east);
- end{tikzpicture}
- end{figure}
- end{document}
- documentclass[12pt]{article}
- usepackage{tikz}
- usetikzlibrary{calc,matrix}
- usepackage{fullpage,amsmath}
- newcommandcheckers[1]{%
- draw [BarreStyle=red] (#1-1-1.120) node[SignePlus=red] {$+$} to (#1-3-3.320) ;
- draw [BarreStyle=red] (#1-1-2.120) node[SignePlus=red] {$+$} to (#1-3-4.320) ;
- draw [BarreStyle=red] (#1-1-3.120) node[SignePlus=red] {$+$} to (#1-3-5.320) ;
- draw [BarreStyle=blue] (#1-1-3.35) node[SigneMoins=blue] {$-$} to (#1-3-1.230);
- draw [BarreStyle=blue] (#1-1-4.35) node[SigneMoins=blue] {$-$} to (#1-3-2.230);
- draw [BarreStyle=blue] (#1-1-5.35) node[SigneMoins=blue] {$-$} to (#1-3-3.230);
- draw let p1 = (#1-3-3.south east), p2 = ( $ (#1-1-3.north east)!.5!(#1-1-4.north) $ ) in (p2) -- (x2,y1);
- draw let p1 = (#1-1-1.north west), p2 = (#1-3-1.south west) in (p2) -- (x2,y1);
- }
- tikzset{BarreStyle/.style = {opacity=.4,line width=4mm,line cap=round,color=#1}}
- tikzset{SignePlus/.style = {above left,,opacity=0.8,circle,inner sep=1pt,fill=#1!50}}
- tikzset{SigneMoins/.style = {above right,,opacity=0.8,circle,inner sep=1pt,fill=#1!50}}
- begin{document}
- begin{figure}
- tikzset{node style ge/.style={circle}}
- centering
- begin{tikzpicture}[baseline=(A.center)]
- matrix (A) [matrix of math nodes, nodes = {node style ge},column sep=0 mm,nodes={text width=1em,align=right}]
- { i & j & k & i & j \
- 3 & -2 & 2 & 3 & -2 \
- 31 & 2 & 61 & 3 & 2 \
- };
- checkers{A}
- end{tikzpicture}\[1em]
- begin{tikzpicture}[baseline=(B.center)]
- matrix (B) [matrix of math nodes, nodes = {node style ge},column sep=0 mm,nodes={text width=1em,align=right}]
- { i & j & k & i & j \
- 13 & -2 & 25 & 13 & -2 \
- 3 & -18 & 1 & 3 & 2 \
- };
- checkers{B}
- end{tikzpicture}
- end{figure}
- end{document}
- documentclass[12pt]{article}
- usepackage{tikz}
- usetikzlibrary{calc,matrix}
- usepackage{fullpage,amsmath}
- newcommandcheckers[7]{%
- begin{tikzpicture}[baseline=(#1.center)]
- tikzset{BarreStyle/.style = {opacity=.4,line width=4mm,line cap=round,color=##1}}
- tikzset{SignePlus/.style = {above left,opacity=0.8,circle,inner sep=1pt,fill=##1!50}}
- tikzset{SigneMoins/.style = {above right,opacity=0.8,circle,inner sep=1pt,fill=##1!50}}
- tikzset{node style ge/.style={circle}}
- matrix (#1) [matrix of math nodes, nodes = {node style ge},column sep=0 mm,nodes={text width=1.8em,align=right,font=footnotesize},ampersand replacement = &]
- { i & j & k & i & j \
- #2 & #3 & #4 & #2 & #3 \
- #5 & #6 & #7 & #5 & #6 \
- };
- draw [BarreStyle=red] (#1-1-1.120) node[SignePlus=red] {$+$} to (#1-3-3.320) ;
- draw [BarreStyle=red] (#1-1-2.120) node[SignePlus=red] {$+$} to (#1-3-4.320) ;
- draw [BarreStyle=red] (#1-1-3.120) node[SignePlus=red] {$+$} to (#1-3-5.320) ;
- draw [BarreStyle=blue] (#1-1-3.35) node[SigneMoins=blue] {$-$} to (#1-3-1.230);
- draw [BarreStyle=blue] (#1-1-4.35) node[SigneMoins=blue] {$-$} to (#1-3-2.230);
- draw [BarreStyle=blue] (#1-1-5.35) node[SigneMoins=blue] {$-$} to (#1-3-3.230);
- draw let p1 = (#1-3-3.south east), p2 = ( $ (#1-1-3.north east)!.5!(#1-1-4.north) $ ) in (p2) -- (x2,y1);
- draw let p1 = (#1-1-1.north west), p2 = (#1-3-1.south west) in (p2) -- (x2,y1);end{tikzpicture}
- }
- begin{document}
- begin{figure}
- centering
- checkers{A}{3}{-2}{2}{31}{2}{61}\[1em]
- checkers{B}{13}{-2}{25}{3}{-18}{1}
- end{figure}
- end{document}
- documentclass{standalone}
- usepackage{tikz}
- usetikzlibrary{calc,matrix,backgrounds,fit}
- usepackage{amsmath}
- newcommandcheckers[1]{
- begin{pgfonlayer}{background}
- tikzset{
- bar style/.style={inner ysep=-.1em,inner xsep=1em,rounded corners=.8em},
- fillop/.style={fill=##1,fill opacity=.3},
- sign/.style={circle,inner sep=.2em,fillop=##1,text opacity=1},
- }
- foreach posa in {1,2,3}{
- pgfmathsetmacro{posb}{posa + 2}
- node[bar style=red,rotate fit=-45,
- fit=(#1-1-posa)(#1-3-posb),fillop=red,
- label={[sign=red]west:$+$}]{};
- node[bar style=red,rotate fit=45,
- fit=(#1-1-posb)(#1-3-posa),fillop=blue,
- label={[sign=blue]east:$-$}]{};
- }
- draw let p1=($(#1-1-3)!.5!(#1-1-4)$) in
- (p1 |- #1.north) -- (p1 |- #1.south);
- draw (#1.north west) -- (#1.south west);
- end{pgfonlayer}
- }
- begin{document}
- begin{tikzpicture}
- matrix (A)
- [matrix of math nodes,inner sep=0pt,
- nodes={minimum size=2.5em,inner sep=0pt}]
- {
- i & j & k & i & j \
- 3 & -2 & 2 & 3 & -2 \
- 61 & 2 & 61 & 3 & 2 \
- };
- checkers{A}
- end{tikzpicture}
- {footnotesize%
- begin{tikzpicture}
- matrix (B)
- [matrix of math nodes,inner sep=0pt,
- nodes={minimum size=2.5em,inner sep=0pt}]
- {
- i & j & k & i & j \
- 13 & -2 & 125 & 13 & -2 \
- 3 & -18 & 1 & 3 & 2 \
- };
- checkers{B}
- end{tikzpicture}%
- }
- end{document}
Add Comment
Please, Sign In to add comment