1

I wanted to draw the following figure using Latexenter image description here

I am not sure which packages should I use. Any pointers towards the solution would be of great help

1
  • 1
    You are not sure which package you should use, so how can you find out the tag tikz-pgf? Btw, please make your image clearer - I can't get it; and also give us what you have tried.
    – user156344
    Mar 31, 2019 at 7:22

2 Answers 2

1

I would actually recommend tikz-3dplot for that.

\documentclass[tikz,border=3.14mm]{standalone} 
\usepackage{tikz-3dplot} 
\usetikzlibrary{3d} 
\begin{document} 
\tdplotsetmaincoords{60}{30} 
\begin{tikzpicture}[tdplot_main_coords] 
 \draw[thick] (-2,0,0) -- (4,0,0) node[pos=-0.1]{$C_1$};
 \draw[thick] (0,-2,0) -- (0,4,0) node[pos=-0.1]{$C_2$};
 \begin{scope}[canvas is yz plane at x=1,rotate=20]
  \draw (0,0) -- (2,0) -- (0,-1) -- (2,-1) -- (0,0) -- (0,-1) -- (-2,-1);
  \draw[dashed] (2,-1) -- (2,1) -- (-2,-1);
 \end{scope}
\end{tikzpicture}
\end{document}

enter image description here

This allows you to work with 3d coordinates and to change the view at will.

\documentclass[tikz,border=3.14mm]{standalone} 
\usepackage{tikz-3dplot} 
\usetikzlibrary{3d} 
\begin{document} 
\foreach \X in {5,15,...,355}
{\tdplotsetmaincoords{60+10*sin(\X)}{\X} 
\begin{tikzpicture}[tdplot_main_coords]
 \path[use as bounding box] [tdplot_screen_coords] (-4,-3) rectangle (4,3);
 \draw[thick] (-2,0,0) -- (4,0,0) node[pos=-0.1]{$C_1$};
 \draw[thick] (0,-2,0) -- (0,4,0) node[pos=-0.1]{$C_2$};
 \begin{scope}[canvas is yz plane at x=1,rotate=20]
  \draw (0,0) -- (2,0) -- (0,-1) -- (2,-1) -- (0,0) -- (0,-1) -- (-2,-1);
  \draw[dashed] (2,-1) -- (2,1) -- (-2,-1);
 \end{scope}
\end{tikzpicture}}
\end{document}

enter image description here

2
  • (+1 - nice answer :)) I don't think this is what the OP really wants. Looking at the right angle notations, I think the OP is trying to draw some reflections in 2D.
    – user156344
    Mar 31, 2019 at 15:31
  • @JouleV Honestly I do not know. The OP's figure is very hard to read, and many interpretations are possible. Well, now they have two options....
    – user121799
    Mar 31, 2019 at 15:35
4

Adding text is for you, because my eyes find it too hard to read.

\documentclass{standalone}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[scale=.5]
\coordinate (o) at (0,0);
\draw (-4,-2) coordinate (s1)--(6,3) coordinate (e1) (-4,2) coordinate (s2)--(6,-3) coordinate (e2);
\coordinate (a) at (-.5,-6);
\tkzDefPointBy[reflection=over s2--e2](a) \tkzGetPoint{b}
%\tkzDefPointBy[reflection=over s1--e1](b) \tkzGetPoint{c}: this cause great whitespace, I don't know why
\coordinate (c) at (5.9,1.2);
\draw[dashed] (a)--(b)--(c);
\draw (c)--(a);
\path (2,-1) coordinate (hab);
\path ($(a)!(hab)!(c)$) coordinate (hac);
\path ($(b)!(o)!(c)$) coordinate (hbc);
\draw (hab)--(hac)--(hbc)--cycle (hab)--(c);
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .