If circle and line is a draw command as below, is it possible to get intersection? for this example, the C point now is hardcoded.   \documentclass[border=5pt,convert={density=300,outext=.jpg}]{standalone} \usepackage{tikz}  \usetikzlibrary{positioning} \begin{document} \tikzset{&gt;=latex} \tiny\begin{tikzpicture}  \coordinate (O) at (0,0);  \coordinate (A) at (1,0);  \coordinate (B) at (1,1.732);  \draw[-&gt;] (0,0) -- (2,0);  \draw[-&gt;] (0,0) -- (0,2);  \draw (A) circle (1);  \draw (A) -- (1,2);  \draw (O) -- (B);  \coordinate (C) at (0.5,0.861);//fix me with intersection of circle and line  \draw (A) -- (C);   % annotation  \draw[fill=red] (O) circle (1pt)  node[below left=0 of O] {O};  \draw[fill=red] (A) circle (1pt)  node[below right=0 of A] {A};  \draw[fill=red] (B) circle (1pt)  node[above right=0 of B] {B};  \draw[fill=red] (C) circle (1pt)  node[above left=0 of C] {C}; \end{tikzpicture}  \end{document}   Output:
115563
Why does this example only partially work?  \documentclass{minimal} \usepackage{etex} \usepackage{tikz} \usetikzlibrary{shapes,calc,arrows,trees,positioning,through,intersections,fadings} \begin{document}     \begin{tikzpicture}[scale=0.5] \coordinate (a) at (0,0); \coordinate (b) at (6,0); \coordinate (c) at (9,6); \node(A)[label=$A$] at (a) {$\bullet$}; \node(B)[label=50:$B$] at (b)  {$\bullet$}; \node(C)[label=$C$] at (c) {$\bullet$}; \draw[thick] (a)--(b)--(c)--cycle; %           \node(c1) at (a)[draw,circle through=(b)] {}; %           \coordinate(ac) at(intersection 1 of c1 and a--c); %            %           \node(c2) at (ac)[draw,circle through=(b)] {}; %           \node(c3) at (b)[draw,circle through=(ac)] {}; %           \coordinate(bta) at(intersection 1 of c2 and c3 ); %           \node(xx)[label=$C$] at (bta) {$\bullet$}; %       \coordinate(bisa) at(intersection 1 of a--bta and b--c); %       \draw (a)--(bisa); %%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%%         \node(c4) at (b)[draw,circle through=(a)] {};             \coordinate(bc) at(intersection 1 of c4 and b--c);             \node(xx)[label=$prova$] at (bc) {$\bullet$};             \node(c5) at (bc)[draw,circle through=(a)] {};             \node(c6) at (a)[draw,circle through=(bc)] {};             \coordinate(btb) at(intersection 1 of c5 and c6 );         \node(xx)[label=$prova$] at (btb) {$\bullet$};         \coordinate(bisb) at(intersection 1 of b--btb and a--c);         \draw (b)--(bisb); %%%%%%%%%%%%%%%%%%%%%%%%%%% work %%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work%%%%%%%%%%%%%%%%%% \node(c7) at (c)[draw,circle through=(b)] {}; \coordinate(ac) at(intersection 2 of c7 and a--c); \node(xx)[label=$prova2$] at (ac) {$\bullet$}; %%%%%%%%%%%%%%%%%%%%%%%%%%% it doesn't work %%%%%%%%%%%%%%%%%%  \end{tikzpicture} \end{document}
19967
I make frequent use of |- and -| with computed points in diagrams, like so:  \coordinate (a) at (0,0); \foreach \x in (1,...,10) {     \coordinate (b) at ({whateverFunction(\x)},{whateverOtherFunction(\x)});     \draw (a) |- (b); %Straight line segment     \draw (b) -| (a); %Another straight line segment     \coordinate (a) at (b); }   To get plots like:   I would like to be able to label the midpoint of each line segment, but doing something like node[midway,above] {a} does not act like expected:    I want something like:    Why does midway not work, and what is a good workaround here?
65999
Ok so I have been trying to draw this figure:     I have made it till the above diagram. The three captions that I made in the topmost picture is what that is remaining. 1. The outer boundary of the rectangle should also be colored blue or some color.  2. The small circles should be labeled with a matrix.  3. The rectangle should be filled with horizontal lines  Here is the code for what I have done:      \documentclass{article} % say \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw  (0,5) node (yaxis) [above] {$y$} |- (5,0) node (xaxis) [right] {$x$}; \draw (-0.5,0) -- (4,0); \draw (0,-0.5) -- (0,4); \definecolor{mycolor}{RGB}{178,181,255} \filldraw[fill=mycolor] (0,0) rectangle (2,2); \filldraw [cyan] (0,2) circle [radius=2pt]; \filldraw [cyan] (2,0) circle [radius=2pt];  \end{tikzpicture} \end{document}   Any help would be appreciated.
104879
I want to draw a triangle (with the package TikZ). I don't know how to draw the line, which links the BC points. I know I have to use these commands: +(a,b), ++(a,b), (a:b|-c,d). Unfortunately I cannot use any of these commands, so please explain, how to use these commands and what do they mean.  Please, introduce the commands in detail.  And also, I need the line, which links the points AB. I do not need the points and the "=45°" in my LaTeX document.
63436
I'm trying to draw arrows with / marks and numbers like in the following picture:    My current solution looks like this:  \begin{tikzpicture}     [         inverter/.style={rectangle,draw,inner sep=2pt,minimum size=6mm},         dot/.style={circle,inner sep=0pt,minimum size=0.5mm,draw,fill=black}     ]     \node (x) at (0,0) {$x$};     \node (delta) at (1,0) [shape=rectangle,draw,minimum height=18mm,minimum width=6mm] {$\delta$};      \node(ah)     at ( 2,  0.5) [inverter] {$a_h$};     \node(al)     at ( 2, -0.5) [inverter] {$a_l$};      \draw [-&gt;] (x) -- (delta);      \draw [-&gt;,dashed,dash pattern=on 1pt off 1pt] (delta.58.75) -- (ah);     \node at ($ (ah) - (0.55, 0) $) {\scriptsize /};     \node at ($ (ah) - (0.5, 0.2) $) {\tiny 4};     \draw [-&gt;,dashed,dash pattern=on 1pt off 1pt] (delta.-58.75) -- (al);     \node at ($ (al) - (0.55, 0) $) {\scriptsize /};     \node at ($ (al) - (0.5, 0.2) $) {\tiny 4}; \end{tikzpicture}   which is pretty hacky and doesn't look nice. I tried strike out shapes but found the line to be much too long. However, positioning a / and a number manually seems like a pretty bad solution to me. I've seen a similar question that revolved around striking out lines or arrows, but without any numbering. Any input would be most welcome.
23465
I'm trying to draw a boundary around a convex set of circular nodes in TikZ. The aim is to have it padded by 1cm, with an arc at the corners between segments, like this:    I currently have the following code:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc}  \begin{document} \begin{tikzpicture}[every node/.style={circle,draw=blue}]    \node at (0,0) (a) {};   \node at (1,3) (b) {};   \node at (2,2) (c) {};    \draw[red]   ($(a)!1cm!-90:(c)$)   let \p1 = ($(a)!1cm!-90:(c) - (a)$),     \n1 = {atan2(\x1,\y1)},     \p2 = ($(a)!1cm!90:(b) - (a)$),     \n2 = {atan2(\x2,\y2)},     \n{delta} = {-Mod(\n1-\n2,360)}   in      arc [start angle=\n1, delta angle=\n{delta}, radius=1cm]   --   ($(b)!1cm!-90:(a)$)   let \p1 = ($(b)!1cm!-90:(a) - (b)$),     \n1 = {atan2(\x1,\y1)},     \p2 = ($(b)!1cm!90:(c) - (b)$),     \n2 = {atan2(\x2,\y2)},     \n{delta} = {-Mod(\n1-\n2,360)}   in      arc [start angle=\n1, delta angle=\n{delta}, radius=1cm]   --   ($(c)!1cm!-90:(b)$)   let \p1 = ($(c)!1cm!-90:(b) - (c)$),     \n1 = {atan2(\x1,\y1)},     \p2 = ($(c)!1cm!90:(a) - (c)$),     \n2 = {atan2(\x2,\y2)},     \n{delta} = {-Mod(\n1-\n2,360)}   in      arc [start angle=\n1, delta angle=\n{delta}, radius=1cm]   -- cycle;  \end{tikzpicture} \end{document}   I'm going to have to draw a lot of these, so it would useful if I could replace the \draw statement by something like:  \draw[red] \convexpath{(a) (b) (c)}{1cm};   where (a) (b) (c) are the nodes in the corners of the convex set in a clockwise direction. In the case of one node I would like it to draw a circle of the specified radius around the node in question.  Does anyone have any suggestions for how to go about writing such a macro?
41863
Questions:   Why are the top corners of this number line missing? Why aren't the bottom corners or any other corners of this number line missing? How do I ensure the corners are always there?     \documentclass{article}  \usepackage[left=1.5cm,right=1.5cm,top=2cm,bottom=2cm]{geometry} \usepackage{tikz}   \begin{document}  \begin{tikzpicture}[line width=0.08cm]  \draw (0,0)--(5,0); \draw (0,0.3)--(5,0.3);  \foreach \x in {0,...,5}  {  \node at (\x,-0.55) {\x};  \draw (\x,-0.3)--(\x,0.3);  }  \foreach \x in {0,...,5}  \draw (\x,0)--(\x,0.3);  \end{tikzpicture}  \end{document}   That code yields this:
63680
I am interested in outputting  this graph in  latex using tikz:    So far I got this:    and my tikz code is   \begin{tikzpicture}     \node[shape=circle,draw=black] (A) at (0,0) {A};     \node[shape=circle,draw=black] (B) at (0,3) {B};     \node[shape=circle,draw=black] (C) at (2.5,4) {C};     \node[shape=circle,draw=black] (D) at (2.5,1) {D};     \node[shape=circle,draw=black] (E) at (2.5,-3) {E};     \node[shape=circle,draw=black] (F) at (5,3) {F} ;      \path [-&gt;] (A) edge node[left] {$5$} (B);     \path [-&gt;](B) edge node[left] {$3$} (C);     \path [-&gt;](A) edge node[left] {$4$} (D);     \path [-&gt;](D) edge node[left] {$3$} (C);     \path [-&gt;](A) edge node[right] {$3$} (E);     \path [-&gt;](D) edge node[left] {$3$} (E);     \path [-&gt;](D) edge node[top] {$3$} (F);     \path [-&gt;](C) edge node[top] {$5$} (F);     \path [-&gt;](E) edge node[right] {$8$} (F);    \end{tikzpicture}   I want to know how to draw the arc between nodes B and E and also thicker  arcs with their lengths in center. Any help is appreciated
32955
If you have a line passing through the middle of a circle, does it create a right angle at the intersection of the line and curve? More generally, is it valid to define an angle created between a line and a curve? Is the tangent to the curve at the point of intersection a valid interpretation (I.e a semi circle has 2 right angles) I saw it in a debate thread and it got me curious now.
109781
I have a graph that consists of x and y from Z/11. Is it possible to programmatically draw the lines that have a slope of 2?  Like from (0,0) to (5,10) and (6,12) would become (6,1) because of modulo 11. Just like the graph below.    For that graph I use the following code. But I have to manually calculate the start and end points.      \begin{tikzpicture}     \coordinate (Origin)   at (0,0);     \coordinate (XAxisMin) at (0,0);     \coordinate (XAxisMax) at (11,0);     \coordinate (YAxisMin) at (0,0);     \coordinate (YAxisMax) at (0,11);      \draw [thick, gray,-latex] (XAxisMin) -- (XAxisMax);% Draw x axis     \draw [thick, gray,-latex] (YAxisMin) -- (YAxisMax);% Draw y axis      \foreach \x in {0,1,...,10}{% Two indices running over each       \foreach \y in {0,1,...,10}{% node on the grid we have drawn          \node[draw,circle,inner sep=1pt,fill] at (\x,\y) {};             % Places a dot at those points       }     }      \draw [thin, blue,-latex] (Origin) -- (5,10);       \draw [thin, blue,-latex] (6,1) -- (10,9); \end{tikzpicture}
33045
I would like to have the unit circle, centered at the origin, on the Cartesian plane drawn.  The origin is to be marked with a dot and labeled "O" and five dots are to be drawn on the circle, one on the x-axis, and the others at k(2\pi/5) radians from the positive x-axis for each integer 1 \leq k &lt; 5, and they are to be labeled "w_{k}".  Arrows are to be drawn from the origin to each w_{k}, too. One angle is to be drawn and labeled - the one from the positive x-axis to the ray through w_{1}.  I have included some of the code.  It starts with the following commands.  \tikzset{mydot/.style={fill,circle,inner sep=1.5pt}}   Is there a manual that explains each of these commands?  I guess that this is instructing LaTeX how to make the dots indicating the coordinates each time "\mydot" is in the code.  \documentclass{amsart} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsthm} \usepackage{newlfont} \usepackage{mathtools} \usepackage{tikz}  \tikzset{ mydot/.style={   fill,   circle,   inner sep=1.5pt   } }  \begin{document}  \begin{tikzpicture}[&gt;=latex]   % the coordinates of the vertices \coordinate (O) at (0,0); \coordinate (w_{1}) at (\cos(2\pi/5), \sin(2\pi/5));  % the axes \draw[help lines,-&gt;] (-1.5,0) -- (1.5,0); \draw[help lines,-&gt;] (0,-1.5) -- (0,1.5);  % labelling the vertices \node[mydot,label={below:$O$}] at (O) {}; \node[mydot,label={right:$w_{1} = \bigl(\cos(2\pi/5), \sin(2\pi/5)\bigr)$}] at (w_{1}) {};   % the arcs for the angle \begin{scope}[gray] \draw[-&gt;]   (1,0) +(0:0.5cm) arc [radius=1cm,start angle=0,end angle=2\pi/5] node[midway,right] {$2\pi/5$}; \end{scope}  \end{tikzpicture} \end{document}
87448
I'm wondering if there are some macros for annotating listings as below easily. They are primarily used in books from Manning.    Solution  For anyone who's interested, this is my macro I finally got:      \newcommand*{\AddNote}[5]{%     \begin{tikzpicture}[overlay, remember picture]     \coordinate (x) at (#2,0);     \coordinate (a) at ($(x)!(#1.north)!($(x)+(0,1)$)$);     \coordinate (b) at ($(a)+(0.8,0)$);     \coordinate (c) at ($(b)+(0,#3)$);     \draw [open triangle 45-] (a) -- (b) -- (c);     \node[#5] at (c) {\bf\sffamily\smaller#4};     \end{tikzpicture}%     }   Usage is: \AddNote{linemarker}{x-offset}{y-offset}{text}{style}
58426
I am trying to draw the below given figure. Please help me to plot it in Tikz. I am only able to plot concentric circles. . I would like to have different colors in between different circles. Also, the text should be along the curve. The arrow in between the two concentric circles does not have to overlap with the circle on the right hand side.  I would be grateful if you could help me in plotting this in Tikz. Please let me know if you need more information. Thanks!  \documentclass[conference]{IEEEtran}  \ifCLASSINFOpdf  \else  \fi  \usepackage[usenames,dvipsnames]{color} \usepackage[T1]{fontenc} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{arrows} \usetikzlibrary{shapes.multipart} \usepackage[caption=false]{subfig} \usepackage{tabularx,tikz} \usepackage{graphicx} \usepackage{color} \usepackage{pdfpages} \begin{document}  \title{Practice Tex}   \maketitle  \section{Introduction}  \begin{figure} \begin{center} \begin{tikzpicture}     \draw(0,0) circle (0.4cm)   node[draw=none,sloped,above]{cxvzxcv};         \draw(0,0) circle (0.75cm) node[draw=none,sloped,above]{ratio};    \draw(0,0) circle (1.25cm);   \node[draw=none,align=center, font=\scriptsize,text width = 1.25cm] at (0,2.2) {22};    \draw(0,0) circle (2cm);   \node[draw=none,align=center, font=\scriptsize,text width = 1.25cm] at (0,3.8) {33333};    \draw(0,-9) circle (0.4cm);   \node[draw=none,align=center, font=\scriptsize,text width = 1.25cm] at (0,-9) {fsgsdgf};      \draw(0,-9) circle (0.75cm);   \node[draw=none,align=center, font=\scriptsize,text width = 1.25cm] at (0,-7.8) {fgdsfg};    \draw(0,-9) circle (1.25cm) node[midway,sloped] at (0,-9) {dfsdfad};    \draw(0,-9) circle (2.8cm);   \node[draw=none,align=center, font=\scriptsize,text width = 1.25cm] at (0,-6.4) {dfsdfsd};    \draw(0,-9) circle (3.2cm);   \node[draw=none,align=center, font=\scriptsize,text width = 1.25cm] at (0,-6) {dfsdfsd};    \draw(0,-9) circle (3.6cm);   \node[draw=none,align=center, font=\scriptsize,text width = 1.25cm] at (0,-5.6) {sfdsfd};    \draw(0,-9) circle (4.4cm);   \node[draw=none,align=center, font=\scriptsize,text width = 1.25cm] at (0,-4.8) {sdfsf};     \pgfsetlinewidth{3pt}    \draw [-implies][-&gt;] (0,-4) -- (0,-4.6);   \end{tikzpicture}  \end{center} \end{figure} \end{document}
64041
Can someone please explain me why the following code doesn't result in a fill?  And why, sometimes, I get such "very thin lines" artifact (that's visibile in my picture)?  \begin{tikzpicture} \node (A) at (0,0) {A}; \node (B) at (1,0) {B}; \node (C) at (1,1) {C}; \fill[red] (A) -- (B) -- (C) --cycle; \end{tikzpicture}   Here's what I get:
43216
I have the following tikz code  % compilation command: pdflatex --jobname=Diag-f1 Diag.tex \documentclass{book} \usepackage{tikz} \pgfrealjobname{Diag} \begin{document} \beginpgfgraphicnamed{Diag-f1} \begin{tikzpicture}[node distance=3em] \node(G)[rectangle,fill=red!5,draw=red,text width=5cm]{}; \node(H)[below of=G]{H}; \node(H1)[left of=H]{H1}; \node(H2)[right of=H]{H2}; \draw[-&gt;](G.south)-|(H1.north); \draw[-&gt;](G.south)--(H.north); \draw[-&gt;](G.south)-|(H2.north); \end{tikzpicture} \endpgfgraphicnamed \end{document}     but I am not happy with the two arrows going from G.south to H1.north and H2.north. Because of the -| command, there is a spurious horizontal line. How can I achieve the same result without this annoying horizontal line? \draw[-&gt;](G.south)--(H1.north); is not a solution. There are available tricks but I may have missed an obvious solution here.
76329
I would like to delete, from the following figure:  the top circle, but without removing the black edge that separate the orange part from the gray part. The figure above has been obtained by the following code: \documentclass[border=0.2cm]{standalone}  % Required packages \usepackage[dvipsnames]{xcolor} \usepackage{tikz}   \begin{document} \begin{tikzpicture}[thick, set/.style = {circle,      minimum size = 3cm,      fill=black!30}]  % Set A \node[set,label={135:$A$}] (A) at (0,0) {};  % Set B \node[set,label={45:$B$}] (B) at (1.8,0) {};   % Intersection \begin{scope} \clip (0,0) circle(1.5cm); \clip (1.8,0) circle(1.5cm); \clip (0.9,1.5) circle(1.5cm); \fill[orange!60](0,0) circle(1.5cm); \end{scope}  % Circles outline \draw (0,0) circle(1.5cm); \draw (1.8,0) circle(1.5cm); \draw (0.9,1.5) circle(1.5cm);  \end{tikzpicture} \end{document}  A rough example of the desired result is:
11547
\begin{tikzpicture} \node [draw=black, anchor=south west] (label) at (0,0){\includegraphics[width=300mm]{th.jpg}}; \coordinate (ZX) at (157mm,104mm); \coordinate (YB) at (249mm,39mm); \coordinate (YY) at ($(ZX)!1.5!(YB)$); \coordinate (ZZ) at ($(YB)!2.5!(ZX)$); \draw[blue!20,very thick] (ZZ)--(YY); \draw[red!20,very thick, rotate around={90:(ZX)}] (157mm,104mm)--(249mm,39mm);%It works \draw[red!20,very thick, rotate around={-90:(ZX)}] (ZX)--(YB);%It doesn't work \filldraw[white] (ZX) circle (2mm); \filldraw[white] (YB) circle (2mm); \end{tikzpicture}   a working example       \documentclass{minimal} \usepackage{tikz,tikz-3dplot}  \begin{document}    \tdplotsetmaincoords{70}{115}    \begin{tikzpicture}[scale=4,tdplot_main_coords] \pgfmathsetmacro{\rvec}{.8} \pgfmathsetmacro{\thetavec}{30} \pgfmathsetmacro{\phivec}{60}  \tdplotsetrotatedcoords{\phivec}{\thetavec}{0}   \coordinate (O) at (1,1,1);   %these 2 lines overlap \draw[thick,-&gt;] (O) -- (0,.5,0); \draw[thick,tdplot_rotated_coords,-&gt;] (O) -- (0,.5,0);   %these 2 lines dont overlap \draw[thick,-&gt;] (1,1,1) -- (0,.5,0); \draw[thick,tdplot_rotated_coords,-&gt;] (1,1,1) -- (0,.5,0); \end{tikzpicture} \end{document}