1

Source:

Better solution to display the Distributive Property

Question:

When i came across the answer given by Peter Grill,

i am very interesting to know that how we can extend(modify) this codes for this type of multiplication (a+b)(c+d)=ac+ad+bc+bd

I mean how can we draws arrows between the parts of these two brackets.

I tried lot at my best level but couldn't find the appropriate corrections.

CODE:

\documentclass{article}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\newcommand{\DrawBox}[2]{%
  \begin{tikzpicture}[overlay,remember picture]
    \draw[->,shorten >=5pt,shorten <=5pt,out=70,in=130,distance=0.5cm,#1] (MarkA.north) to (MarkC.north);
    \draw[->,shorten >=5pt,shorten <=5pt,out=50,in=140,distance=0.3cm,#2] (MarkA.north) to (MarkB.north);
  \end{tikzpicture}
}
\begin{document}
    \LARGE
\[\tikzmark{MarkA}(a+b)(c\tikzmark{MarkB}+d\tikzmark{MarkC})=ac+ad+bc+bd \DrawBox{OrangeRed,distance=1cm,in=110,shorten >=10pt}{Cerulean,out=115,in=70,distance=1.5cm}\]


\end{document}
  • 1
    No problem, you can show us what you tried and we will help you to correct it. – Ignasi Jun 27 '16 at 8:34
2
\documentclass{article}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}

\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}

\begin{document}
\[(\tikzmark{MarkA}a+\tikzmark{MarkB}b)(c\tikzmark{MarkC}+d\tikzmark{MarkD})=ac+ad+bc+bd   
\begin{tikzpicture}[overlay,remember picture]
    \draw[->,shorten >=5pt,shorten <=5pt,out=70,in=110,distance=0.75cm,OrangeRed,] (MarkA.north) to (MarkD.north);
    \draw[->,shorten >=5pt,shorten <=5pt,out=60,in=110,distance=0.5cm,Cerulean] (MarkA.north) to (MarkC.north);
    \draw[->,shorten >=1pt,shorten <=2pt,out=-70,in=-110,distance=0.5cm,OrangeRed,] (MarkB.south) to (MarkD.south);
    \draw[->,shorten >=1pt,shorten <=2pt,out=-60,in=-110,distance=0.25cm,Cerulean] (MarkB.south) to (MarkC.south);
  \end{tikzpicture}
\]

\end{document}

enter image description here

  • IT LOOKS NICE..... IT WORKS MILLION THANKS TO YOU – Maths4Sandy Jun 27 '16 at 11:11

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.