如何自由绘制曲线?

如何自由绘制曲线?

我画了下面的图:

在此处输入图片描述

\begin{center}

\begin{tikzpicture}[scale=0.4]

\draw[ultra thick] (0,0) circle [radius=2];

 \draw [thick,domain=0:60] plot ({2*cos(\x)}, {2*sin(\x)}); 

\draw [ultra thick,color=red,domain=0:60] plot ({2.1*cos(\x)}, {2.1*sin(\x)});  

\draw[thick,dashed ] 

(-4,0)--(4,0)

(0,-4)--(0,4);

\draw[ultra thick] (-8,-8)--(-5,6);

\draw[thick,dashed,] (-5.4,4)--(1,1.7); 

\draw[thick] (0,0)--(1,1.7);

\node at (-2.2,2.9) {\textbf{>}};

\node at (-6.3,0) {$\bullet$};

\node at (-6.6,0) {\textbf{0}};

\node at (-5.4,4) {$\bullet$};

    \node at (-5.7,4) {\textbf{x}};

\node at (4,0) {\textbf{>}};

    \node at (-4,0) {\textbf{<}};


    \node at (0,4) {\textbf{$\wedge$}};

    \node at (0,-4) {$\vee$};

    \node at (2.2,1.6) {$x_{o}$};

\end{tikzpicture}

\end{center}

但是,我想用自由曲线代替虚线,以便绘图类似于此:

在此处输入图片描述

答案1

有三种可能性;其中两种使用out=,in=语法,另一种使用控制点:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{tikz}

\begin{document}

\begin{center}
\begin{tikzpicture}[
  scale=0.4,
  mydot/.style={
    fill,
    circle,
    inner sep=1.5pt}
]

\draw[ultra thick] (0,0) circle [radius=2];
\draw [thick,domain=0:60] plot ({2*cos(\x)}, {2*sin(\x)});
\draw [ultra thick,color=red,domain=0:60] plot ({2.1*cos(\x)}, {2.1*sin(\x)});

\draw[thick,dashed,latex-latex]
(-4,0)--(4,0);
\draw[thick,dashed,latex-latex]
(0,-4)--(0,4);
\draw[ultra thick] 
  (-8,-8)--(-5,6);

\draw[red,thick,dashed,-latex,shorten >= 3pt] 
  (-5.4,4) to[out=10,in=90,looseness=2] (1,1.7);
\draw[green,thick,dashed,-latex,shorten >= 3pt] 
  (-5.4,4) to[out=20,in=90] (3,4) to[out=-90,in=45] (1,1.7);
\draw[blue,thick,dashed,-latex,shorten >= 3pt] 
  (-5.4,4) .. controls (6,7) and (4,5) .. (1,1.7);

\draw[thick] (0,0)--(1,1.7);

\node[mydot,label={left:$\mathbf{0}$}] at (-6.3,0) {};
\node[mydot,label={left:$\mathbf{x}$}] at (-5.4,4) {};
\node at (2.2,1.6) {$x_{o}$};

\node at (0,7) {$\mathbb{R}^{2}$};
\node at (-4.8,7) {$\mathbb{R}$};
\end{tikzpicture}
\end{center}

\end{document}

在此处输入图片描述

如果您希望箭头位于路径的中间,那么使用装饰:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}

\begin{center}
\begin{tikzpicture}[
  scale=0.4,
  mydot/.style={
    fill,
    circle,
    inner sep=1.5pt},
  decoration={
    markings,
    mark=at position 0.5 with {\arrow{latex}}
  }  
]

\draw[ultra thick] (0,0) circle [radius=2];
\draw [ultra thick,color=red,domain=0:60] plot ({2.1*cos(\x)}, {2.1*sin(\x)});

\draw[thick,dashed,latex-latex]
(-4,0)--(4,0);
\draw[thick,dashed,latex-latex]
(0,-4)--(0,4);
\draw[ultra thick] 
  (-8,-8)--(-5,6);

%\draw[red,thick,dashed,postaction={decorate},shorten >= 3pt] 
  %(-5.4,4) to[out=10,in=90,looseness=2] (1,1.7);
%\draw[green,thick,dashed,postaction={decorate},shorten >= 3pt] 
  %(-5.4,4) to[out=20,in=90] (3,4) to[out=-90,in=45] (1,1.7);
\draw[blue,thick,dashed,postaction={decorate},shorten >= 3pt] 
  (-5.4,4) .. controls (6,7) and (4,5) .. (1,1.7);

\draw[thick] (0,0)--(1,1.7);

\node[mydot,label={left:$\mathbf{0}$}] at (-6.3,0) {};
\node[mydot,label={left:$\mathbf{x}$}] at (-5.4,4) {};
\node at (2.2,1.6) {$x_{o}$};

\node at (0,7) {$\mathbb{R}^{2}$};
\node at (-4.8,7) {$\mathbb{R}$};
\end{tikzpicture}
\end{center}

\end{document}

在此处输入图片描述

我还对您的代码做了一些其他修改;主要是使用适当的箭头提示,为填充点定义样式,以及使用选项label放置\node一些标签。

相关内容