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 would like to know what exactly do the parameters in and out map to the path used.

Specifically, say I draw a path with

\begin{tikzpicture}
\draw (0,0) to [in=30, out=40] (5,0);
\end{tikzpicture}

How could I draw the same path using controls, if possible.

In the manual I only managed to find that using in and out in the to specification translates to using a special path, but I couldn't find exactly which path and I am not sufficiently versed in TeX to read the sources.

share|improve this question
    
Welcome to TeX.sx! –  Kurt Apr 13 '13 at 15:23
add comment

1 Answer

up vote 8 down vote accepted

The controls may be expressed as points relative to the start and end points, and this may be done in polar form. The first control has angle of out and the second angle of in. Now in the abscence of other options the length of the controls are equal to 0.3915 times the distance between the start and end points. Thus in your case the distance is 5 and the control length is 1.9675:

Sample output

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}

\begin{tikzpicture}
\draw[blue] (0,0) to [in=30, out=40] (5,0);
\draw[red,dashed] (0,0) .. controls +(40:1.9675) and +(30:1.9575) .. (5,0);
\end{tikzpicture}

\end{document}

The number 0.3915 may be found in the file tikztopathslibrary.code.tex. The manual states that it is chosen so one gets an approximate quarter circle when the directions are at right angles. If a different value of looseness is specified, this is used to scale this factor.

share|improve this answer
add comment

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.