5 初中数学十字相乘法相关的问题

发布于 2021-03-10 12:08:38

对于仅一个的十字相乘法,得到解决方案如下:

\begin{tikzpicture}
    \node (a) at (0,0);
    \node (b) at (2,0);
    \node (c) at (2,1);
    \node (d) at (0,1);
    \draw[-] (a) [red]-- (c);
    \draw[-] (b) [blue]-- (d);
    \draw (a) node [left] {$x+y$};
    \draw (b) node [right] {$2$};
    \draw (c) node [right] {$4$};
    \draw (d) node [left] {$x-3y$};
\end{tikzpicture}

但对于两个十字相乘问题,开始想到如下方法:

\begin{tikzpicture}
    \node (A) at (0,1);
    \node (B) at (2,1);
    \node (C) at (4,1);
    \node (D) at (0,0);
    \node (E) at (2,0);
    \node (F) at (4,0);
    
    \draw (A) node [left] {$2x$};
    \draw (B) node {$-3y$};
    \draw (C) node [right] {$z$};
    \draw (D) node [left] {$3x$};
    \draw (E) node {$y$};
    \draw (F) node [right] {$-2z$};
    
    \draw [-] (A.east) -- (E.west);
    \draw [-] (D.east) -- (B.west);
    \draw [-] (B.east) -- (F.west);
    \draw [-] (E.east) -- (C.west);
    \draw [-] (A.east) [dashed]-- (F.west);
    \draw [-] (D.east) [dashed]-- (C.west);
    \end{tikzpicture}

但是效果不好。

这后,想到拆成两个组合,勉强可以使用:

\begin{tikzpicture}
\node (a) at (0,0);
\node (b) at (2,0);
\node (c) at (2,1);
\node (d) at (0,1);
\draw[-] (a) [red]-- (c);
\draw[-] (b) [blue]-- (d);
\draw (a) node [left] {$3x$};
\draw (b) node [right] {$-2y$};
\draw (c) node [right] {$-3y$};
\draw (d) node [left] {$2x$};

\node (e) at (3,0);
\node (f) at (5,0);
\node (g) at (5,1);
\node (h) at (3,1);
\draw[-] (e) [red]-- (g);
\draw[-] (h) [blue]-- (f);
\draw (f) node [right] {$5$};
\draw (g) node [right] {$4$};
    
\draw [-] (a.east) [dashed]-- (g.west);
\draw [-] (d.east) [dashed]-- (f.west);
\end{tikzpicture}

但感觉方法不好。大家有没有好的建议?
多谢。

image.png

查看更多

关注者
0
被浏览
1.6k
乙醇
乙醇 2021-03-10
这家伙很懒,什么也没写!
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
    \begin{tikzpicture}
        \node (A) at (0, 1.5) {$ 2x $};
        \node (B) at (0, 0) {$ 3x $};
        \node (C) at (3, 1.5) {$ -3y $};
        \node (D) at (3, 0) {$ -2y $};
        \node (E) at (6, 1.5) {$ 4 $};
        \node (F) at (6, 0) {$ 5 $};

        \draw (A.east) -- (D.west);
        \draw[dashed] (A.east) -- (F.west);
        \draw (B.east) -- (C.west);
        \draw[dashed] (B.east) -- (E.west);
        \draw (C.east) -- (F.west);
        \draw (D.east) -- (E.west);
    \end{tikzpicture}
\end{document}

node 可以直接写文字.
image.png

4 个回答
拿了橘子跑啊
拿了橘子跑啊 2021-03-10
这家伙很懒,什么也没写!

方法很多,

  1. 你可以用\makebox[2em][c]{$xxx$} 作为 node 的文字内容,这样需要对齐的节点的宽度就是一致的了,只要内容自然宽度不超过给定的宽度;
  2. 你可以用[every node./style={minimum size=7mm}] 之类的设置全局设定好 node 的最小宽度,当然,内容自然宽度超过这个数值的 node 其宽度还是自然宽度;
  3. 个别需要设定最小宽度的 node 也可以专门为其加选项参数 [minimum size =7mm]
寄存器
寄存器 2021-03-10
这家伙很懒,什么也没写!

也可以试试matrix库:

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary {matrix}

\begin{document}

  \begin{tikzpicture}
    \matrix (m) [matrix of nodes, column sep=15mm, row sep=8mm, inner sep=0.0mm,]
    {
      $2x$ & $-3y$ & $4$ \\
      $3x$ & $-2y$ & $5$ \\
    };
    \draw[blue] (m-1-1) -- (m-2-2);
    \draw[blue] (m-1-2) -- (m-2-3);
    \draw[red ] (m-2-1) -- (m-1-2);
    \draw[red ] (m-2-2) -- (m-1-3);
    \draw[dashed] (m-1-1) -- (m-2-3);
    \draw[dashed] (m-2-1) -- (m-1-3);
  \end{tikzpicture}

\end{document}

image.png

海波
海波 2021-03-10
这家伙很懒,什么也没写!

我将点的名称,与标注内容分开,为的方便看。如果再有类似的地方,可以晚方便的看出要改动的地方。比如,我只是将标注的式子更了,可以只看那一部分代码。

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览