Graphics, Figures & Tablescontinous curved lines

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jhapk
Posts: 81
Joined: Tue Apr 20, 2010 9:33 pm

continous curved lines

Post by jhapk »

Hi,

how do I make continous curved lines with more than 2 control points which can turn at 3 or 4 points?

example attached
Screenshot.png
Screenshot.png (9.86 KiB) Viewed 1832 times
thanks
Last edited by jhapk on Wed Jul 28, 2010 7:22 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

continous curved lines

Post by localghost »

You can use a sequence of (cubic) Bézier curves. You only have to take care that you choose the right control points at the connecting point of two curves.

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}

\begin{document}
  \begin{tikzpicture}[>=stealth]
    \draw[thick,dashed] (0,0) .. controls (0,0.5) and (1,1) .. (1,2)
                              .. controls (1,3) and (0.5,3) .. (0,4);
%    \draw[gray] (0,0) -- (0,0.5) -- (1,1) -- (1,2) -- (1,3) -- (0.5,3) -- (0,4);
    \begin{scope}[shift={(0.5,0)}]
      \draw[thick] (0,0) .. controls (0,1) and (1,1) .. (1,2.5)
                         .. controls (1,3) and (0.5,3.5) .. (0,4);
%      \draw[gray] (0,0) -- (0,1) -- (1,1) -- (1,2.5) -- (1,3) -- (0.5,3.5) -- (0,4);
    \end{scope}
    \begin{scope}[shift={(1,0)}]
      \draw[thick,dashed] (0,0) .. controls (0,1.5) and (1,1) .. (1,2)
                                .. controls (1,3) and (0,3.5) .. (0,4);
%      \draw[gray] (0,0) -- (0,1.5) -- (1,1) -- (1,2) -- (1,3) -- (0,3.5) -- (0,4);
    \end{scope}
    \node (F) at (-1,3.5) [text width=1.2cm,text centered] {Fuel $Z=1$};
    \draw[->] (F) -- (0.6,3);
    \node (Z) at (-1,2) [text width=1.2cm,text centered] {$Z=Z_\text{st}$};
    \draw[->] (Z) -- (1.4,2);
    \node (O) at (2.5,3.5) [text width=1.2cm,text centered] {Oxidizer $Z=0$};
    \draw[->] (O) -- (2,2.5);
  \end{tikzpicture}
\end{document}
The commented lines connect the control points for better orientation.


Thorsten
Post Reply