在绘图中添加曲线

在绘图中添加曲线

感谢这个论坛,我学会了一点如何处理绘图。现在我画了这个三角形,但我不知道如何像示例中那样添加曲线。在此处输入图片描述

我为三角形编写的代码是这样的:

    \documentclass[a4paper,12pt]{book}
    \usepackage[T1]{fontenc}
    \usepackage[utf8]{inputenc}
    \usepackage[english,italian]{babel}
    \usepackage{url,amsfonts,epsfig}
    \usepackage{amsmath}
    \usepackage{caption}
    \usepackage{subcaption}
    \usepackage[backend=biber]{biblatex}

   \usepackage{tikz}
   \usetikzlibrary{calc,quotes,angles}
   \usepgflibrary{arrows.meta}
   \usepackage{pgfplots}
   \usetikzlibrary{calc}

   \begin{document}

   \begin{figure}[h]
   \centering
   \begin{tikzpicture}[>=latex]
    \centering
    \coordinate (A) at (0,0);
    \coordinate (B) at (7,0);
    \coordinate (C) at (5,-4);
    \coordinate (ABmid) at (A -| C);
    \coordinate (D) at (7,-4);

    \draw[thick] (A)--(B);
    \draw[->] [thick] (C)--(A) node[left,midway]{$W_1$};
    \draw[->] [thick] (C)--(B) node[right,midway]{$C_1$};
    \draw [thick,dashed] (C)--(D);

    \draw[->] [thick] (C)--(ABmid) node[left,pos=0.7]{$C_{a1}$};
    \draw[->] [thick] ($(B)+(0,5pt)$)--($(ABmid) +(0,5pt)$) node[above,pos=0.5]{$C_{\theta1}$};
    \draw[->] [thick] ($(A)+(0,30pt)$)--($(B) +(0,30pt)$) node[above,pos=0.5]{$U_1$};

    \pic["$\beta_{1b}$",draw, angle eccentricity=1.2,angle radius=15mm] {angle = C--A--B};      
    \pic["$\alpha_1$",draw, angle eccentricity=1.2,angle radius=12mm] {angle = D--C--B};


   \end{tikzpicture}
   \caption{\textit{Triangoli di velocità all'inducer}}
   \label{fig:Triangoli inducer}
   \end{figure}

   \end{document}

答案1

因为无论如何你都可以使用它来测量从到的calc直线的斜率,并在语法中使用该斜率来绘制这些曲线。ABto[out=<slope>,in=-90]

\documentclass[a4paper,12pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
% \usepackage[english,italian]{babel}
% \usepackage{url,amsfonts}
% \usepackage{amsmath}
% \usepackage{caption}
% \usepackage{subcaption}
% \usepackage[backend=biber]{biblatex}

\usepackage{tikz}
\usetikzlibrary{arrows.meta,babel,calc,quotes,angles}

\begin{document}

\begin{figure}[h]
\centering
\begin{tikzpicture}[>=latex]
 \centering
 \coordinate (A) at (0,0);
 \coordinate (B) at (7,0);
 \coordinate (C) at (5,-4);
 \coordinate (ABmid) at (A -| C);
 \coordinate (D) at (7,-4);

 \draw[thick] (A)--(B);
 \draw[->] [thick] (C) to["$W_1$"] (A);
 \draw[->] [thick] (C) to["$C_1$"'] (B);
 \draw [thick,dashed] (C)--(D);

 \draw[->] [thick] (C)to["$C_{a1}$" {pos=0.7}](ABmid);
 \draw[->] [thick] ($(B)+(0,5pt)$)--($(ABmid) +(0,5pt)$) node[above,pos=0.5]{$C_{\theta1}$};
 \draw[->] [thick] ($(A)+(0,30pt)$) --($(B) +(0,30pt)$) node[above,pos=0.5]{$U_1$};

 \pic["$\beta_{1b}$",draw, angle eccentricity=1.2,angle radius=15mm] {angle = C--A--B};      
 \pic["$\alpha_1$",draw, angle eccentricity=1.2,angle radius=12mm] {angle = D--C--B};

 \draw[thick] let \p1=($(C)-(A)$),\n1={atan2(\y1,\x1)+180}
 in (A) to[out=\n1,in=-90] ++(-0.3,2) -- ++ (7,0)
 (A) to[out=\n1,in=-90] ++(-0.8,2) -- ++ (-2,0) coordinate(aux)
 ($(aux)+(0,0.5)$) -- ++ (10,0);

\end{tikzpicture}
\caption{\textit{Triangoli di velocit\'a all'inducer.}}
\label{fig:Triangoli inducer}
\end{figure}

\end{document}

在此处输入图片描述

相关内容