1

I am a TikZ newbie and am struggling to create a plot showing three planes and their point of intersection for the following system of linear equations:

enter image description here

I would like to have something similar (or better!) than this plot that I have generated using GeoGebra:

enter image description here

During my search process, I came across this solution, which when expanded will give me what I want, but I am unsure on what to change in the code to create the planes based on the equations. Thanks for help in advance!

Update: Thanks to Schrodinger's cat's solution that he linked in the comment, I was able to get the desired output (open to feedbacks to make it even better)! Basically, I just found four points that satisfy each equation and then draw a cycle using their coordinates.

Here is the code that I used:

\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{60}{120}
\begin{tikzpicture}[tdplot_main_coords, font = \sffamily]
    \draw[-latex] (0, 0, 0) -- (4, 0, 0) node[left] {$x$};
    \draw[-latex] (0, 0, 0) -- (0, 4, 0) node[below] {$y$};
    \draw[-latex] (0, 0, 0) -- (0, 0, 4) node[left] {$z$};
    \draw[fill = red, opacity = 0.2] (2, 4, 3) -- (-2, -4, 3) -- (-2, -4, -3) -- (2, 4, -3) -- cycle;
    \draw (2, 4, 3) -- (-2, -4, 3) -- (-2, -4, -3) -- (2, 4, -3) -- cycle;
    \draw[fill = blue, opacity = 0.2] (2, 2, 3) -- (-4, -1, 3) -- (-4, -4, -3) -- (2, -1, -3) -- cycle;
    \draw (2, 2, 3) -- (-4, -1, 3) -- (-4, -4, -3) -- (2, -1, -3) -- cycle;
    \draw[fill = green, opacity = 0.1] (3, 4, 4) -- (3, -4, -2) -- (-3, -4, -2) -- (-3, 4, 4) -- cycle;
    \draw (3, 4, 4) -- (3, -4, -2) -- (-3, -4, -2) -- (-3, 4, 4) -- cycle;
    \draw[fill = gray, opacity = 0.2] (-4, -4, 0) -- (-4, 4, 0) -- (4, 4, 0)
    -- (4, -4, 0) -- cycle;
    \fill[red] (0, 0, 1) circle (3pt);
    \node[anchor = south west, align = center] (line) at (4, 6, 3.5)
    {Solution \\ intersection};
    \draw[-latex] (line) to[out = 180, in = 75] (0.05, 0.05, 1.1);
\end{tikzpicture}
\end{document}

And here's what I got:

enter image description here

Ashirwad
  • 201
  • TikZ is not a computer algebra system. While it might be possible to teach TikZ to draw the planes on the basis of the equations, it will not be easy to find out their intersections and to draw the various bits and pieces in the right order. –  Sep 22 '19 at 02:07
  • @Schrödinger'scat, how about manually finding three points that lie on each plane and draw planes using those points? Is it doable? – Ashirwad Sep 22 '19 at 02:15
  • You still need to find out the right drawing order. See e.g. https://tex.stackexchange.com/a/445965/194703. –  Sep 22 '19 at 02:26
  • @Schrödinger'scat, I don't think I fully understood the idea presented in the linked question! But I will take a look again tomorrow to see if I understand it better. – Ashirwad Sep 22 '19 at 02:53
  • I'm voting to close this question as too-broad and -1 for no effort. – Raaja_is_at_topanswers.xyz Sep 22 '19 at 09:56
  • 3
    @Raaja, I would no say the OP made no effort. Yes there is no MWE, but at least it linked a former question. Also The OP commented he would take a look a Schrödinger's cat proposal. It might be good to leave this question open just a few more days, to see if the OP improves his question. – BambOo Sep 22 '19 at 10:50
  • 1
    There is some progress on this question, which I posted here. –  Sep 23 '19 at 21:05
  • @Schrödinger's cat, thanks for pointing me in the right direction! I have updated the question to include my solution, which is largely based on your solution that you had asked me to refer to. Do you have any suggestions to improve it even further? – Ashirwad Oct 07 '19 at 05:21
  • @Raaja, I think you can now add back 1 for showing effort! :) – Ashirwad Oct 07 '19 at 05:24
  • 1
    Yes, decompose the planes in their intersection segments. The reason why things do not look good is that TikZ draw the planes in the order in which you put them in. So you need to draw the intersection segments in the right order. The ordering has been automatized but not the determination of the intersection segments. (You had nothing better to do than choosing really odd angles for the planes, so enjoy figuring out what these segments are. At least the coordinates of the blue plane seem very odd to me and I fail to see a reason why you chose the coordinates as you did.) –  Oct 07 '19 at 15:25

0 Answers0