3次元の曲線の問題

3次元の曲線の問題

S カーブの長さを示したいと思います。同じようにスムーズ アルゴリズムを使用しましたが、カーブが「滑らか」に見えません。

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{tikzpicture}
    [
        >=stealth,
        cm={-1,-1,1,0,(0,0)},
        x=3.85mm,
        z=-1cm, 
        axis/.style={-, black}, 
        vector/.style={-{Stealth[length=6,width=3]}, very thick, black}
    ] 

    \draw (0,0,0) node[left]{$O$};
    \draw[axis] (0,0,0) -- (4,0,0) node[left]{$X$};
    \draw[axis] (0,0,0) -- (0,4,0) node[right]{$Y$};
    \draw[axis] (0,0,0) -- (0,0,4) node[left]{$Z$};

    \draw[vector] (0,0,0) -- (1,1,2) node[circle,fill,inner    sep=0.7pt,label=left:$ A $](){};
    \draw (0.5,0.5,1) node[right]{$ \vec{r}_{0} $};
    \draw[vector] (0,0,0) -- (2.5,4,2.5) node[circle,fill,inner sep=0.7pt,label=right:$ B $](){};
    \draw (1.25,2,1.25) node[below]{$ \vec{r}(t) $};
    \draw[vector] (1,1,2) -- (2.5,4,2.5);
    \draw (1.75,2.25,2.25) node[below]{$ \Delta \vec{r} $};
    \draw [thick] plot [smooth, tension=1] coordinates { (1,1,2) (1.75,2.5,2.5) (2.5,4,2.5)};
    \draw [>=Bracket, <->] plot [smooth, tension=1] coordinates { (1,1,2.25) (1.75,2.5,2.75) (2.5,4,2.75)};
    \draw (1.75,2.5,2.5) node[above]{$ s $};
\end{tikzpicture}
\end{document}

結果は次のとおりです。結果

答え1

さて、問題は座標やその他のものではなく、plot矢印の先端を処理するパス指定子にあります。ここで説明されています:スムーズオプションを使用すると、PGFplots で矢印の先端が誤って表示されることがあるJake は、具体的には PGFplots に矢印の先端を追加するためのソリューションを提供しています。

TikZ を使用しているため、動作しません。ただし、回避策があります。まず、プロットはBrackets以下と同じなので、shiftオプションを使用して、描画をより簡潔にする必要があります。さて、矢印の先端を追加すると問題が発生することがわかったので、先端なしで描画し、後で追加します。

\draw[>={Bracket[]}, postaction={<->, tips=true}, shift={(0,0,.25)}] plot[smooth,...

キーはtips=true矢印の先端を追加するためのルールを上書きし、描画がない場合でも TikZ に矢印を追加するように強制します。結果は次のようになります。

ここに画像の説明を入力してください

ムウェ

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{arrows.meta}

\begin{document}
\begin{tikzpicture}
    [
        >=stealth,
        cm={-1,-1,1,0,(0,0)},
        x=3.85mm,
        z=-1cm, 
        axis/.style={-, black}, 
        vector/.style={-{Stealth[length=6,width=3]}, very thick, black}
    ] 

    \draw (0,0,0) node[left]{$O$};
    \draw[axis] (0,0,0) -- (4,0,0) node[left]{$X$};
    \draw[axis] (0,0,0) -- (0,4,0) node[right]{$Y$};
    \draw[axis] (0,0,0) -- (0,0,4) node[left]{$Z$};

    \draw[vector] (0,0,0) -- (1,1,2) node[circle,fill,inner    sep=0.7pt,label=left:$ A $](){};
    \draw (0.5,0.5,1) node[right]{$ \vec{r}_{0} $};
    \draw[vector] (0,0,0) -- (2.5,4,2.5) node[circle,fill,inner sep=0.7pt,label=right:$ B $](){};
    \draw (1.25,2,1.25) node[below]{$ \vec{r}(t) $};
    \draw[vector] (1,1,2) -- (2.5,4,2.5);
    \draw (1.75,2.25,2.25) node[below]{$ \Delta \vec{r} $};
    \draw [thick] plot [smooth, tension=1] coordinates { (1,1,2) (1.75,2.5,2.5) (2.5,4,2.5)};
    \draw [>={Bracket[]}, postaction={<->, tips=true}, shift={(0,0,.25)}] plot [smooth, tension=1] coordinates { (1,1,2) (1.75,2.5,2.5) (2.5,4,2.5) };
    \draw (1.75,2.5,2.5) node[above]{$ s $};
\end{tikzpicture}
\end{document}

関連情報