Guest User

Untitled

a guest
Jul 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.03 KB | None | 0 0
  1. documentclass[12pt]{article}
  2. usepackage{tikz}
  3. usetikzlibrary{matrix}
  4. usepackage{fullpage,amsmath}
  5. begin{document}
  6.  
  7. begin{align*}
  8. begin{array}{|rrr|rr}
  9. i & j & k & i & j\
  10. 3 & -2 & 2 & 3 & -2\
  11. 3 & 2 & 1 & 3 & 2
  12. end{array}
  13. end{align*}
  14.  
  15. begin{figure}[!htbp]
  16. tikzset{node style ge/.style={circle}}
  17. centering
  18. begin{tikzpicture}[baseline=(A.center)]
  19. tikzset{BarreStyle/.style = {opacity=.4,line width=3 mm,line cap=round,color=#1}}
  20. tikzset{SignePlus/.style = {above left,,opacity=0.8,circle,fill=#1!50}}
  21. tikzset{SigneMoins/.style = {above right,,opacity=0.8,circle,fill=#1!50}}
  22. % les matrices
  23. matrix (A) [matrix of math nodes, nodes = {node style ge},,column sep=0 mm]
  24. { i & j & k & i & j \
  25. 3 & -2 & 2 & 3 & -2 \
  26. 3 & 2 & 1 & 3 & 2 \
  27. };
  28.  
  29. draw [BarreStyle=red] (A-1-1.north west) node[SignePlus=red] {$+$} to (A-3-3.south east) ;
  30. draw [BarreStyle=red] (A-1-2.north west) node[SignePlus=red] {$+$} to (A-3-4.south east) ;
  31. draw [BarreStyle=red] (A-1-3.north west) node[SignePlus=red] {$+$} to (A-3-5.south east) ;
  32. draw [BarreStyle=blue] (A-1-3.north east) node[SigneMoins=blue] {$-$} to (A-3-1.south west);
  33. draw [BarreStyle=blue] (A-1-4.north east) node[SigneMoins=blue] {$-$} to (A-3-2.south west);
  34. draw [BarreStyle=blue] (A-1-5.north east) node[SigneMoins=blue] {$-$} to (A-3-3.south west);
  35. draw (A-1-1.north west) -- (A-3-1.south west); draw (A-1-3.north east) -- (A-3-3.south east);
  36. end{tikzpicture}
  37. end{figure}
  38.  
  39. end{document}
  40.  
  41. documentclass[12pt]{article}
  42. usepackage{tikz}
  43. usetikzlibrary{calc,matrix}
  44. usepackage{fullpage,amsmath}
  45.  
  46. newcommandcheckers[1]{%
  47. draw [BarreStyle=red] (#1-1-1.120) node[SignePlus=red] {$+$} to (#1-3-3.320) ;
  48. draw [BarreStyle=red] (#1-1-2.120) node[SignePlus=red] {$+$} to (#1-3-4.320) ;
  49. draw [BarreStyle=red] (#1-1-3.120) node[SignePlus=red] {$+$} to (#1-3-5.320) ;
  50. draw [BarreStyle=blue] (#1-1-3.35) node[SigneMoins=blue] {$-$} to (#1-3-1.230);
  51. draw [BarreStyle=blue] (#1-1-4.35) node[SigneMoins=blue] {$-$} to (#1-3-2.230);
  52. draw [BarreStyle=blue] (#1-1-5.35) node[SigneMoins=blue] {$-$} to (#1-3-3.230);
  53. draw let p1 = (#1-3-3.south east), p2 = ( $ (#1-1-3.north east)!.5!(#1-1-4.north) $ ) in (p2) -- (x2,y1);
  54. draw let p1 = (#1-1-1.north west), p2 = (#1-3-1.south west) in (p2) -- (x2,y1);
  55. }
  56. tikzset{BarreStyle/.style = {opacity=.4,line width=4mm,line cap=round,color=#1}}
  57. tikzset{SignePlus/.style = {above left,,opacity=0.8,circle,inner sep=1pt,fill=#1!50}}
  58. tikzset{SigneMoins/.style = {above right,,opacity=0.8,circle,inner sep=1pt,fill=#1!50}}
  59.  
  60. begin{document}
  61.  
  62. begin{figure}
  63. tikzset{node style ge/.style={circle}}
  64. centering
  65. begin{tikzpicture}[baseline=(A.center)]
  66. matrix (A) [matrix of math nodes, nodes = {node style ge},column sep=0 mm,nodes={text width=1em,align=right}]
  67. { i & j & k & i & j \
  68. 3 & -2 & 2 & 3 & -2 \
  69. 31 & 2 & 61 & 3 & 2 \
  70. };
  71. checkers{A}
  72. end{tikzpicture}\[1em]
  73. begin{tikzpicture}[baseline=(B.center)]
  74. matrix (B) [matrix of math nodes, nodes = {node style ge},column sep=0 mm,nodes={text width=1em,align=right}]
  75. { i & j & k & i & j \
  76. 13 & -2 & 25 & 13 & -2 \
  77. 3 & -18 & 1 & 3 & 2 \
  78. };
  79. checkers{B}
  80. end{tikzpicture}
  81. end{figure}
  82.  
  83. end{document}
  84.  
  85. documentclass[12pt]{article}
  86. usepackage{tikz}
  87. usetikzlibrary{calc,matrix}
  88. usepackage{fullpage,amsmath}
  89.  
  90. newcommandcheckers[7]{%
  91. begin{tikzpicture}[baseline=(#1.center)]
  92. tikzset{BarreStyle/.style = {opacity=.4,line width=4mm,line cap=round,color=##1}}
  93. tikzset{SignePlus/.style = {above left,opacity=0.8,circle,inner sep=1pt,fill=##1!50}}
  94. tikzset{SigneMoins/.style = {above right,opacity=0.8,circle,inner sep=1pt,fill=##1!50}}
  95. tikzset{node style ge/.style={circle}}
  96.  
  97. 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 = &]
  98. { i & j & k & i & j \
  99. #2 & #3 & #4 & #2 & #3 \
  100. #5 & #6 & #7 & #5 & #6 \
  101. };
  102. draw [BarreStyle=red] (#1-1-1.120) node[SignePlus=red] {$+$} to (#1-3-3.320) ;
  103. draw [BarreStyle=red] (#1-1-2.120) node[SignePlus=red] {$+$} to (#1-3-4.320) ;
  104. draw [BarreStyle=red] (#1-1-3.120) node[SignePlus=red] {$+$} to (#1-3-5.320) ;
  105. draw [BarreStyle=blue] (#1-1-3.35) node[SigneMoins=blue] {$-$} to (#1-3-1.230);
  106. draw [BarreStyle=blue] (#1-1-4.35) node[SigneMoins=blue] {$-$} to (#1-3-2.230);
  107. draw [BarreStyle=blue] (#1-1-5.35) node[SigneMoins=blue] {$-$} to (#1-3-3.230);
  108. draw let p1 = (#1-3-3.south east), p2 = ( $ (#1-1-3.north east)!.5!(#1-1-4.north) $ ) in (p2) -- (x2,y1);
  109. draw let p1 = (#1-1-1.north west), p2 = (#1-3-1.south west) in (p2) -- (x2,y1);end{tikzpicture}
  110. }
  111.  
  112. begin{document}
  113.  
  114. begin{figure}
  115. centering
  116. checkers{A}{3}{-2}{2}{31}{2}{61}\[1em]
  117. checkers{B}{13}{-2}{25}{3}{-18}{1}
  118. end{figure}
  119.  
  120. end{document}
  121.  
  122. documentclass{standalone}
  123. usepackage{tikz}
  124. usetikzlibrary{calc,matrix,backgrounds,fit}
  125. usepackage{amsmath}
  126.  
  127. newcommandcheckers[1]{
  128. begin{pgfonlayer}{background}
  129. tikzset{
  130. bar style/.style={inner ysep=-.1em,inner xsep=1em,rounded corners=.8em},
  131. fillop/.style={fill=##1,fill opacity=.3},
  132. sign/.style={circle,inner sep=.2em,fillop=##1,text opacity=1},
  133. }
  134. foreach posa in {1,2,3}{
  135. pgfmathsetmacro{posb}{posa + 2}
  136. node[bar style=red,rotate fit=-45,
  137. fit=(#1-1-posa)(#1-3-posb),fillop=red,
  138. label={[sign=red]west:$+$}]{};
  139. node[bar style=red,rotate fit=45,
  140. fit=(#1-1-posb)(#1-3-posa),fillop=blue,
  141. label={[sign=blue]east:$-$}]{};
  142. }
  143. draw let p1=($(#1-1-3)!.5!(#1-1-4)$) in
  144. (p1 |- #1.north) -- (p1 |- #1.south);
  145. draw (#1.north west) -- (#1.south west);
  146. end{pgfonlayer}
  147. }
  148.  
  149. begin{document}
  150. begin{tikzpicture}
  151. matrix (A)
  152. [matrix of math nodes,inner sep=0pt,
  153. nodes={minimum size=2.5em,inner sep=0pt}]
  154. {
  155. i & j & k & i & j \
  156. 3 & -2 & 2 & 3 & -2 \
  157. 61 & 2 & 61 & 3 & 2 \
  158. };
  159. checkers{A}
  160. end{tikzpicture}
  161.  
  162. {footnotesize%
  163. begin{tikzpicture}
  164. matrix (B)
  165. [matrix of math nodes,inner sep=0pt,
  166. nodes={minimum size=2.5em,inner sep=0pt}]
  167. {
  168. i & j & k & i & j \
  169. 13 & -2 & 125 & 13 & -2 \
  170. 3 & -18 & 1 & 3 & 2 \
  171. };
  172. checkers{B}
  173. end{tikzpicture}%
  174. }
  175. end{document}
Add Comment
Please, Sign In to add comment