Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to draw an arc from A to dashed vertical line taking C2 as center. First arc center is C1.

\documentclass[10pt,a4paper]{scrbook}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node at (0:0){C1};
\node at (90:1){C2};

\draw[dashed] (0:0) -- (90:6);

\draw (90:2) arc (100:-130:2)node{A};

\end{tikzpicture}

\end{document}
share|improve this question

3 Answers 3

up vote 6 down vote accepted

I might got it wrong but I interpreted the question as a continous path so here it is; (you can separate them anyway)

We can use the let syntax, that allows you to save a node coordinate into a macro \p<number> and then access its components using \x<number> and \y<number>. This requires the calc library to be loaded.

\documentclass[10pt,a4paper]{scrbook}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}

\begin{tikzpicture}
\node at (0:0){C1};
\node (C2) at (90:1){C2};

\draw[dashed] (0:0) -- (90:6);

\draw (90:2) arc (90:-130:2)node(A){A} let \p1=($(A)-(C2)$),
                                         \n1={veclen(\x1,\y1)},
                                         \n2={atan2(\y1,\x1)}
      in arc (\n2:-270:\n1);


\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
Change 100 into 90 (First arc center is C1) then use \atan2(\y1,\x1) to get the correct picture (with PGF/TikZ 3.0). –  Paul Gaborit May 5 at 14:40
    
Last suggestion: you may use -270 instead of 90 in last arc (question is not very clear...). –  Paul Gaborit May 5 at 14:42
    
@PaulGaborit You are right it was both wrong and less beautiful. –  percusse May 5 at 22:09

You can use a scope with a shift of y=1cm:

\documentclass[10pt,a4paper]{scrbook}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node at (0:0){C1};
\node at (90:1)(c2){C2};

\draw[dashed] (0:0) -- (90:6);

\begin{scope}[yshift=1cm]
\draw[ultra thick] (90:2cm) arc (90:-130:2cm)node{A};
\end{scope}
%\draw[red] (c2.center) circle (2cm);    %% Uncomment to check the center

\end{tikzpicture}

\end{document}

enter image description here

enter image description here

share|improve this answer

Not sure if this is the right answer.

I never seen the Tikz coordinate is defined as (0:0), so I couldn't imagine what exactly its mean.

However, I draw a circle to get the right radius and as a prototype. Then I draw the arc from the end of the previous one (blue) and its inverse (red).

\documentclass[10pt,a4paper,twocolumn]{scrbook}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\node at (0:0){C1};
\node at (90:1){C2};

\draw[dashed] (0:0) -- (90:6);

\draw (90:2) arc (100:-130:2)node{A};

\end{tikzpicture}


% %
%   Draw circle to make sure we have the right radius
%
\vfil
\begin{tikzpicture}
    \node at (0:0){C1};
    \node(C2) at (90:1){C2};

    \draw[dashed] (0:0) -- (90:6);

    \draw (90:2) arc (100:-130:2)node(A){A};

    \draw[red] (C2) circle(2.7);

\end{tikzpicture}


% %
%   Draw arc from the end of the previous arc
%

\vfil
\begin{tikzpicture}
    \node at (0:0){C1};
    \node(C2) at (90:1){C2};

    \draw[dashed] (0:0) -- (90:6);

    \draw (90:2) arc (100:-130:2)node(A){A};

    \draw[blue] (A) arc (250:90:2.68);

\end{tikzpicture}


% %
%   Draw inverse of the new arc
%

\vfil
\begin{tikzpicture}
    \node at (0:0){C1};
    \node(C2) at (90:1){C2};

    \draw[dashed] (0:0) -- (90:6);

    \draw (90:2) arc (100:-130:2)node(A){A};

    \draw[blue] (A) arc (250:90:2.68);

    \draw[red] (A) arc (-110:90:2.68);

\end{tikzpicture}

\end{document}

enter image description here

share|improve this answer
    
It's the polar syntax (angle:length). In fact anything with zero length would give the same point. –  percusse May 5 at 14:03
    
It is a good idea to draw a circle to find the radius...and then to use it to draw an arc. –  sandu May 6 at 3:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.