![具有两条切线的简单曲线的曲率](https://linux22.com/image/396416/%E5%85%B7%E6%9C%89%E4%B8%A4%E6%9D%A1%E5%88%87%E7%BA%BF%E7%9A%84%E7%AE%80%E5%8D%95%E6%9B%B2%E7%BA%BF%E7%9A%84%E6%9B%B2%E7%8E%87.png)
答案1
切线来自这个答案并且通过 实现厚拉伸dash pattern
。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.markings,calc,angles,quotes,bending}
\begin{document}
\begin{tikzpicture}[tangent/.style={% from https://tex.stackexchange.com/a/25940/121799
decoration={
markings,% switch on markings
mark=
at position #1
with
{
\coordinate (tangent point-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,0pt);
\coordinate (tangent unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1,0pt);
\coordinate (tangent orthogonal unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,1);
}
},
postaction=decorate
},
use tangent/.style={
shift=(tangent point-#1),
x=(tangent unit vector-#1),
y=(tangent orthogonal unit vector-#1)
},
use tangent/.default=1,declare function={t1=0.34;t2=0.5;}]
\draw[stealth-stealth] (0,6) node[left]{$y$} |- (6,0) coordinate(X) node[below]{$x$};
\draw [preaction={decorate,decoration={markings,mark=at position 0 with
{\pgfmathsetmacro{\myoff}{t1*\pgfdecoratedpathlength}
\pgfmathsetmacro{\myon}{(t2-t1)*\pgfdecoratedpathlength}
\xdef\myoff{\myoff}\xdef\myon{\myon}}}},
tangent=t1,
tangent=t2,
postaction={draw,very thick,dash pattern=on 0pt off \myoff pt on \myon pt
off 3cm}] (2,t2)
to [out=70,in=-190] node[pos=t1,below right] {$M$}
node[pos=t2,below right] {$M_1$}(6,4);
\path [use tangent] (-3,0) coordinate (t11) -- (3,0) coordinate (t12);
\path [use tangent=2] (-3,0) coordinate (t21) -- (3,0) coordinate (t22);
\path (intersection cs:first line={(0,0)--(6,0)},second line={(t11)--(t12)})
coordinate (i1)
(intersection cs:first line={(0,0)--(6,0)},second line={(t21)--(t22)})
coordinate (i2)
(intersection cs:first line={(t11)--(t12)},second line={(t21)--(t22)})
coordinate (i3);
\draw[thin,blue] (i1) -- (t12);
\draw[thin,red] (i2) -- (t22);
\draw[>=latex] let \p1=($(t12)-(t11)$),\p2=($(t22)-(t21)$),
\n1={(atan2(\y1,\x1)+atan2(\y2,\x2))/2} in
pic["$\alpha$" anchor=west, draw,->, angle eccentricity=1,angle radius=4mm] {angle=X--i2--t22}
pic["$\alpha+\Delta\alpha$" anchor=west, draw,->, angle eccentricity=1,angle radius=4mm] {angle=X--i1--t12}
pic["$\Delta\alpha$" {anchor=east,rotate=\n1}, draw,->, angle eccentricity=1,angle
radius=18mm] {angle=i2--i3--i1}
pic["$\Delta\alpha$" {anchor=west,rotate=\n1}, draw,->, angle eccentricity=1,angle
radius=18mm] {angle=t22--i3--t12};
\end{tikzpicture}
\end{document}
当然,切线的位置t1
可以t2
随意调整。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.markings,calc,angles,quotes,bending}
\tikzset{tangent/.style={% from https://tex.stackexchange.com/a/25940/121799
decoration={
markings,% switch on markings
mark=
at position #1
with
{
\coordinate (tangent point-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,0pt);
\coordinate (tangent unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1,0pt);
\coordinate (tangent orthogonal unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,1);
}
},
postaction=decorate
},
use tangent/.style={
shift=(tangent point-#1),
x=(tangent unit vector-#1),
y=(tangent orthogonal unit vector-#1)
},
use tangent/.default=1}
\begin{document}
\foreach \X in {0.48,0.49,...,0.56,0.55,0.54,...,0.49}
{\begin{tikzpicture}[declare function={t1=0.34;t2=\X;}]
\draw[stealth-stealth] (0,6) node[left]{$y$} |- (6,0) coordinate(X) node[below]{$x$};
\draw [preaction={decorate,decoration={markings,mark=at position 0 with
{\pgfmathsetmacro{\myoff}{t1*\pgfdecoratedpathlength}
\pgfmathsetmacro{\myon}{(t2-t1)*\pgfdecoratedpathlength}
\xdef\myoff{\myoff}\xdef\myon{\myon}}}},
tangent=t1,
tangent=t2,
postaction={draw,very thick,dash pattern=on 0pt off \myoff pt on \myon pt
off 3cm}] (2,t2)
to [out=70,in=-190] node[pos=t1,below right] {$M$}
node[pos=t2,below right] {$M_1$}(6,4);
\path [use tangent] (-3,0) coordinate (t11) -- (3,0) coordinate (t12);
\path [use tangent=2] (-3,0) coordinate (t21) -- (3,0) coordinate (t22);
\path (intersection cs:first line={(0,0)--(6,0)},second line={(t11)--(t12)})
coordinate (i1)
(intersection cs:first line={(0,0)--(6,0)},second line={(t21)--(t22)})
coordinate (i2)
(intersection cs:first line={(t11)--(t12)},second line={(t21)--(t22)})
coordinate (i3);
\draw[thin,blue] (i1) -- (t12);
\draw[thin,red] (i2) -- (t22);
\draw[>=latex] let \p1=($(t12)-(t11)$),\p2=($(t22)-(t21)$),
\n1={(atan2(\y1,\x1)+atan2(\y2,\x2))/2} in
pic["$\alpha$" anchor=west, draw,->, angle eccentricity=1,angle radius=4mm] {angle=X--i2--t22}
pic["$\alpha+\Delta\alpha$" anchor=west, draw,->, angle eccentricity=1,angle radius=4mm] {angle=X--i1--t12}
pic["$\Delta\alpha$" {anchor=east,rotate=\n1}, draw,->, angle eccentricity=1,angle
radius=18mm] {angle=i2--i3--i1}
pic["$\Delta\alpha$" {anchor=west,rotate=\n1}, draw,->, angle eccentricity=1,angle
radius=18mm] {angle=t22--i3--t12};
\end{tikzpicture}}
\end{document}
您可以将其嵌入到任何 LaTeX 文档中。
\documentclass[11pt,article]{elsarticle}
\usepackage{tikz}
\usetikzlibrary{decorations.markings,calc,angles,quotes,bending}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[tangent/.style={% from https://tex.stackexchange.com/a/25940/121799
decoration={
markings,% switch on markings
mark=
at position #1
with
{
\coordinate (tangent point-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,0pt);
\coordinate (tangent unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (1,0pt);
\coordinate (tangent orthogonal unit vector-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) at (0pt,1);
}
},
postaction=decorate
},
use tangent/.style={
shift=(tangent point-#1),
x=(tangent unit vector-#1),
y=(tangent orthogonal unit vector-#1)
},
use tangent/.default=1,declare function={t1=0.34;t2=0.5;}]
\draw[stealth-stealth] (0,6) node[left]{$y$} |- (6,0) coordinate(X) node[below]{$x$};
\draw [preaction={decorate,decoration={markings,mark=at position 0 with
{\pgfmathsetmacro{\myoff}{t1*\pgfdecoratedpathlength}
\pgfmathsetmacro{\myon}{(t2-t1)*\pgfdecoratedpathlength}
\xdef\myoff{\myoff}\xdef\myon{\myon}}}},
tangent=t1,
tangent=t2,
postaction={draw,very thick,dash pattern=on 0pt off \myoff pt on \myon pt
off 3cm}] (2,t2)
to [out=70,in=-190] node[pos=t1,below right] {$M$}
node[pos=t2,below right] {$M_1$}(6,4);
\path [use tangent] (-3,0) coordinate (t11) -- (3,0) coordinate (t12);
\path [use tangent=2] (-3,0) coordinate (t21) -- (3,0) coordinate (t22);
\path (intersection cs:first line={(0,0)--(6,0)},second line={(t11)--(t12)})
coordinate (i1)
(intersection cs:first line={(0,0)--(6,0)},second line={(t21)--(t22)})
coordinate (i2)
(intersection cs:first line={(t11)--(t12)},second line={(t21)--(t22)})
coordinate (i3);
\draw[thin,blue] (i1) -- (t12);
\draw[thin,red] (i2) -- (t22);
\draw[>=latex] let \p1=($(t12)-(t11)$),\p2=($(t22)-(t21)$),
\n1={(atan2(\y1,\x1)+atan2(\y2,\x2))/2} in
pic["$\alpha$" anchor=west, draw,->, angle eccentricity=1,angle radius=4mm] {angle=X--i2--t22}
pic["$\alpha+\Delta\alpha$" anchor=west, draw,->, angle eccentricity=1,angle radius=4mm] {angle=X--i1--t12}
pic["$\Delta\alpha$" {anchor=east,rotate=\n1}, draw,->, angle eccentricity=1,angle
radius=18mm] {angle=i2--i3--i1}
pic["$\Delta\alpha$" {anchor=west,rotate=\n1}, draw,->, angle eccentricity=1,angle
radius=18mm] {angle=t22--i3--t12};
\end{tikzpicture}
\caption{Tangents and curvature from the change of slopes.}
\end{figure}
\end{document}