再说一次,有一个数字我似乎弄错了。这是所需的输出:
这是我目前得到的:
这是一个生成我得到的结果的 MWE:
\documentclass[dvipsnames]{standalone}
\usepackage{tikz}
\usetikzlibrary{fit, calc, matrix, positioning, arrows.meta, intersections, through, backgrounds, patterns}
\begin{document}
\begin{tikzpicture}[node distance = 0pt, every pin/.style = {pin distance=11mm, pin edge={stealth-}}, every node/.style = {color=Blue!60!black}, dot/.style = {circle, fill=black, inner sep=0mm, minimum size=2mm, node contents={}}, line/.style = {-stealth, shorten >=1mm, shorten <= 1mm},]
\coordinate (s) at (3,3);
\coordinate (O) at (0,0);
\coordinate (P) at (-0.5,0.5);
\coordinate[right=55mm of O] (X);
\coordinate[above=55mm of O] (Y);
\coordinate[above right=1 and 2 of O] (d);
\coordinate[right=2 of X |- Y] (e);
\coordinate (a) at (10,10);
\draw[-latex] ([xshift=-0.1] O) -- (X) node[right] {$h_1$};
\draw[-latex] ([yshift=-0.1] O) -- (Y) node[above] {$h_2$};
\path[name path=S] (O) -- (45:6);
\coordinate[left =of s -| O] (s1);
\coordinate[below=of s |- O] (s2);
\draw[Blue,thick] let \p1 = ($(s)-(O)$), \n1 = {veclen(\x1,\y1)} in ($(O)+(\n1,0)$) arc(0:90:\n1);
\draw[Blue,thick] let \p1 = ($(s)-(P)$), \n1 = {veclen(\x1,\y1)} in ($(P)+(\n1,0)$) arc(0:83.5:\n1);
\node[dot,at=(s),pin=60:{$f(T,d)=f(S,d)$}];
\node[below] at (1,1) {$d$};
\node[below] at (1,4) {$S$};
\draw[fill] (1,1) circle (2pt);
\path[name path=D] (s2) -- (15:8);
\end{tikzpicture}
\end{document}
有人能帮我得到想要的输出吗?我担心我漏掉了一些相当愚蠢的东西,但我不知道那是什么。提前感谢大家的时间。
答案1
您可以从arc
x 轴上方的 0.5 开始,因为它的起点是(P)+(\n1,0)
,并且P
位于 (-0.5,0.5)。您还可以从该点逆时针绘制曲线,以将其延伸至轴,即
\draw[Blue,thick] let
\p1 = ($(s)-(P)$),
\n1 = {veclen(\x1,\y1)}
in
($(P)+(\n1,0)$) arc(0:83.4:\n1)
($(P)+(\n1,0)$) arc(0:-6.6:\n1);
但也许更简单的方法是借助库来剪切两个圆圈,through
即
\begin{scope}
\clip (X) rectangle (Y);
\node [draw,thick,circle,Blue,circle through=(s)] at (O) {};
\node [draw,thick,circle,Blue,circle through=(s)] at (P) {};
\end{scope}
完整的代码,我删除了一些未使用的元素,并稍微整理了一下:
\documentclass[dvipsnames]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, positioning, arrows.meta, through}
\begin{document}
\begin{tikzpicture}[
node distance = 0pt,
every pin/.style = {pin distance=11mm, pin edge={Stealth-}},
every node/.style = {color=Blue!60!black},
dot/.style = {circle, fill=black, inner sep=0mm, minimum size=2mm, node contents={}},
]
\coordinate (s) at (3,3);
\coordinate (O) at (0,0);
\coordinate (P) at (-0.5,0.5);
\coordinate[right=55mm of O] (X);
\coordinate[above=55mm of O] (Y);
\draw[Latex-Latex] (Y) node[above] {$h_2$} -- (O) -- (X) node[right] {$h_1$};
%alternative 1
%\begin{scope}
%\clip (X) rectangle (Y);
%\node [draw,thick,circle,Blue,circle through=(s)] at (O) {};
%\node [draw,thick,circle,Blue,circle through=(s)] at (P) {};
%\end{scope}
% alternative 2
\draw[Blue,thick] let
\p1 = ($(s)-(O)$),
\n1 = {veclen(\x1,\y1)}
in
($(O)+(\n1,0)$) arc(0:90:\n1);
\draw[Blue,thick] let
\p1 = ($(s)-(P)$),
\n1 = {veclen(\x1,\y1)}
in
($(P)+(\n1,0)$) arc(0:83.4:\n1)
($(P)+(\n1,0)$) arc(0:-6.6:\n1);
% end alternative 2
%%%%%%%
\node[dot,at=(s),pin=60:{$f(T,d)=f(S,d)$}];
\node[dot,at={(1,1)},label=below:{$d$}];
\node[below] at (1,4) {$S$};
\end{tikzpicture}
\end{document}
计算角度
为了避免通过反复试验在代码中寻找角度,您可以计算它们,参见下面的示例。
\documentclass[dvipsnames,border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, positioning, arrows.meta, through,intersections}
\begin{document}
\begin{tikzpicture}[
node distance = 0pt,
every pin/.style = {pin distance=11mm, pin edge={Stealth-}},
every node/.style = {color=Blue!60!black},
dot/.style = {circle, fill=black, inner sep=0mm, minimum size=2mm, node contents={}},
]
\coordinate (s) at (3,3);
\coordinate (O) at (0,0);
\coordinate (P) at (-0.5,0.5);
\coordinate[right=55mm of O] (X);
\coordinate[above=55mm of O] (Y);
% note name path=axis
\draw[Latex-Latex,name path=axis] (Y) node[above] {$h_2$} -- (O) -- (X) node[right] {$h_1$};
\draw[Blue,thick] let
\p1 = ($(s)-(O)$),
\n1 = {veclen(\x1,\y1)}
in
($(O)+(\n1,0)$) arc[start angle=0,end angle=90,radius=\n1];
% define circle around P through s
\path[overlay,name path=circle] let
\p1 = ($(s)-(P)$),
\n1 = {veclen(\x1,\y1)}
in
(P) circle[radius=\n1];
% calculate angles between P and intersection points with circle and axis lines
\draw[Red,thick,name intersections={of=axis and circle,name=i}] let
\p1 = ($(i-1)-(P)$),
\p2 = ($(i-2)-(P)$),
\n1 = {veclen(\x1,\y1)},
\n2 = {atan2(\y1,\x1)},
\n3 = {atan2(\y2,\x2)}
in
(i-1) arc[radius=\n1,start angle=\n2,end angle=\n3];
\node[dot,at=(s),pin=60:{$f(T,d)=f(S,d)$}];
\node[dot,at={(1,1)},label=below:{$d$}];
\node[below] at (1,4) {$S$};
\end{tikzpicture}
\end{document}
答案2
为了不必担心计算,画一个完整的圆圈,以及clip
我们感兴趣的部分(右上象限)。
\documentclass[dvipsnames]{standalone}
\usepackage{tikz}
\usetikzlibrary{fit, calc, matrix, positioning, arrows.meta, intersections, through, backgrounds, patterns}
\begin{document}
\begin{tikzpicture}[node distance = 0pt, every pin/.style = {pin distance=11mm, pin edge={stealth-}}, every node/.style = {color=Blue!60!black}, dot/.style = {circle, fill=black, inner sep=0mm, minimum size=2mm, node contents={}}, line/.style = {-stealth, shorten >=1mm, shorten <= 1mm},]
\coordinate (s) at (3,3);
\coordinate (O) at (0,0);
\coordinate (P) at (-0.5,0.5);
\coordinate[right=55mm of O] (X);
\coordinate[above=55mm of O] (Y);
\coordinate[above right=1 and 2 of O] (d);
\coordinate[right=2 of X |- Y] (e);
\coordinate (a) at (10,10);
\draw[-latex] ([xshift=-0.1] O) -- (X) node[right] {$h_1$};
\draw[-latex] ([yshift=-0.1] O) -- (Y) node[above] {$h_2$};
\path[name path=S] (O) -- (45:6);
\coordinate[left =of s -| O] (s1);
\coordinate[below=of s |- O] (s2);
\draw[Blue,thick] let \p1 = ($(s)-(O)$), \n1 = {veclen(\x1,\y1)} in ($(O)+(\n1,0)$) arc(0:90:\n1);
\begin{scope}
\clip (X) rectangle (Y);
\draw[Blue,thick] let \p1 = ($(s)-(P)$), \n1 = {veclen(\x1,\y1)} in ($(P)+(\n1,0)$) arc(0:360:\n1);
\end{scope}
\node[dot,at=(s),pin=60:{$f(T,d)=f(S,d)$}];
\node[below] at (1,1) {$d$};
\node[below] at (1,4) {$S$};
\draw[fill] (1,1) circle (2pt);
\path[name path=D] (s2) -- (15:8);
\end{tikzpicture}
\end{document}
答案3
还有一个可能的解决方案(基于您以前类似问题的经验):
\documentclass[tikz,dvipsnames,margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, backgrounds, calc, fit, intersections,
matrix, positioning,
through, patterns}
\begin{document}
\begin{tikzpicture}[node distance = 10mm and 20mm,
every pin/.style = {pin distance=11mm, pin edge={stealth-}},
every node/.style = {color=Blue!60!black},
dot/.style = {circle, fill=black, inner sep=0mm, minimum size=2mm, node contents={}},
line/.style = {-stealth, shorten >=1mm, shorten <= 1mm}
]
\coordinate (O) at (0,0);
\coordinate[above right=of O] (d);
% axis
\draw[-latex] (-0.1,0) -- (6.5,0) node[right] {$h_1$};
\draw[-latex] (0,-0.1) -- (0,5.5) node[above] {$h_2$};
% arc
\draw[Blue,thick,name path=A] (4.0,0) arc(0:90:4);
\draw[TealBlue,thick,name path=B] (4.5,0) arc(0:90:5 and 3.5);
% intersection, dashed S line
\draw[densely dashed, name intersections={of=A and B, by={s}}]
(s -| O) -| ( s|- O) node[pos=0.25,above] {$S$};
\node[dot,at=(s), pin=above right:{$f(T,d)=f(S,d)$}];
% d point
\node[dot,at=(d), label=below:$d$];
\end{tikzpicture}
\end{document}
附录:如果S
和T
是弧的名称,则以下 MWE 显示如何执行此操作:
\documentclass[tikz,dvipsnames,margin=3mm]{standalone}
\usetikzlibrary{arrows.meta, backgrounds, calc, fit, intersections,
matrix, positioning,
through, patterns}
\begin{document}
\begin{tikzpicture}[node distance = 10mm and 20mm,
every pin/.style = {pin distance=11mm, pin edge={stealth-}},
every node/.style = {color=Blue!60!black},
dot/.style = {circle, fill=black, inner sep=0mm, minimum size=2mm, node contents={}},
line/.style = {-stealth, shorten >=1mm, shorten <= 1mm}
]
\coordinate (O) at (0,0);
\coordinate[above right=of O] (d);
% axis
\draw[-latex] (-0.1,0) -- (6.5,0) node[right] {$h_1$};
\draw[-latex] (0,-0.1) -- (0,5.5) node[above] {$h_2$};
% arc
\draw[Blue,thick,name path=A] (4.0,0) arc(0:90:4) node[above right] {$S$};
\draw[TealBlue,thick,name path=B] (4.5,0) arc(0:90:4.5 and 3.5) node[above right] {$T$};
% intersection, dashed S line
\coordinate[densely dashed, name intersections={of=A and B, by={s}}];
\node[dot,at=(s), pin=75:{$f(T,d)=f(S,d)$}];
% d point
\node[dot,at=(d), label=below:$d$];
\end{tikzpicture}
\end{document}