Would it be possible to visualize a roundabout in LaTeX? There has been a car crash in a roundabout and i would like to visualize it for presenting it very clearly, is this possible? its a two lane roundabout and i would only need to visualize two cars
-
It does not need to be a video, just two frames – LaTeX User. Jun 25 '19 at 15:48
-
2Welcome to TeX.SX! On this site, a question should typically revolve around an abstract issue (e.g. "How do I get a double horizontal line in a table?") rather than a concrete application (e.g. "How do I make this table?"). Questions that look like "Please do this complicated thing for me" tend to get closed because they are either "off topic", "too broad", or "unclear". Please try to make your question clear and simple by giving a minimal working example (MWE): you'll stand a greater chance of getting help. – Stefan Pinnow Jun 25 '19 at 15:56
-
I currently do not have the knowledge to even give a MWE, and i do understand that this is quite specific, but i think because of it, you can understand more exactly what i want, and really im also just looking for a simple answer if this would be just dumb to do in LaTeX or if it is easily feasible – LaTeX User. Jun 25 '19 at 15:59
-
I do not expect someone to fully visualize this for me but if someone could atleast point me in the right direction would be awesome, and just answer if this is technically feasible or just stupid because it would be too complicated to do in LaTeX – LaTeX User. Jun 25 '19 at 16:01
-
2You could look at the answers to this question to get a starting point. Like the others above, I am not convinced that LaTeX is the most convenient choice for this task. – Jun 25 '19 at 16:49
1 Answers
There are multiple ways to approach this, a very simple and straightforward approach is to make use of the polar coordinate system in TikZ together with the relative coordinates. Polar coordinates are given in the form (-10:1.75) where -10 is the angle and 1.75 is the distance from (0,0). Arcs can be drawn by stating arc (290:360:0.2) where 290 is the starting angle, 360 is the ending angle and 0.2 is the radius of the arc.
My basic idea is then to have the center of the roundabout at (0,0) and draw everything around it. The three arms of the roundabout could be located anywhere, therefore it is the easiest to always use the outer circle of the roundabout as the starting point, then draw relatively from there. More sophisticated ways are possible, if you would need this multiple times.
Car and bus symbols are taken from fontawesome, but of course it would be possible to draw them as TikZ pics and then refer to them anytime, if you need them frequently, they could even be configurable shapes in color and type. So here is a very basic way of doing it, that didn't take more than 10 minutes of drawing time:
\documentclass[tikz,border=5mm]{standalone}
\usepackage{fontawesome}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (1);
\draw[dashed] (0,0) circle (1.5);
\draw (20:2) arc (20:70:2) arc (250:180:0.2) -- ++(0,1);
\draw (20:2) arc (200:270:0.2) -- ++(1,0);
\draw[dashed] (0,2) -- (0,3);
\draw (-2,0) arc (180:110:2) arc (290:360:0.2) -- ++(0,1);
\draw (-2,0) arc (180:250:2) arc (70:0:0.2) -- ++(0,-1);
\draw[dashed] (0,-2) -- (0,-3);
\draw (-20:2) arc (160:90:0.2) -- ++(1,0);
\draw[dashed] (2,0) -- (3,0);
\draw (-20:2) arc (-20:-70:2) arc (-250:-180:0.2) -- ++(0,-1);
\node(mycar) at (-10:1.75){\faCar};
\node(accidentbus) at (2.5,0.25){\faBus};
\draw[->] (mycar) -- ++(80:0.5);
\draw[->] (accidentbus) -- ++(180:0.5);
\end{tikzpicture}
\end{document}
The results looks like this:
- 5,240
