我正在尝试使用 tikz 获取以下图表,但是无法实现:
这是我迄今为止最好的尝试:
这是产生我的(相当糟糕的)尝试的 MWE:
\documentclass[standalone]
\usepackage{tikz}
\usetikzlibrary{fit, calc, matrix, positioning, arrows.meta, intersections, through, backgrounds, patterns}
\begin{document}
\begin{tikzpicture}[my plot/.style={thick, smooth, samples=100, domain=0:1}, my grid/.style={densely dotted,opacity=0.5, every node/.style={black,opacity=1}}, my axis/.style={latex-latex},scale=0.75]
\coordinate (start plot) at (0,{(0)});
\coordinate (end plot) at (6,{(6)});
\draw[my axis] ([shift={(-0cm,0cm)}]start plot |- end plot) node[above] {$h_2$} |- node[coordinate](origin){} ([shift={(0cm,-0cm)}]start plot -| end plot) node[right] {$h_1$};
\def\x{0.5}\def\y{4}\def\p{0.55}
\draw[Red,thick,domain=0:90] plot ({cos(\x)}, {sin(\x)});
\end{tikzpicture}
\end{document}
关于如何获得所需输出的任何线索? 感谢大家的时间!
答案1
这个图像相当复杂:
\documentclass [tikz, margin=3mm]{standalone}
\usetikzlibrary{arrows, calc, intersections, positioning}
\usepackage{sansmath}
\begin{document}
\begin{tikzpicture}[
node distance = 0pt,
every pin/.style = {pin distance=11mm, pin edge={stealth-}},
every node/.style = {font=\sansmath, 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[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);
% main axis
\draw[->] ([xshift=-0.1] O) -- (X) node[right] {$h_1$};
\draw[->] ([yshift=-0.1] O) -- (Y) node[above] {$h_2$};
% hyperbolas
\draw[blue, thick,name path=A] ($(e)-(5.4,0)$) arc(180:270:5.5 and 4.4);
\draw[blue, thick, scale=0.9,name path=B] ($(e)-(5.4,0)$) arc(180:270:5.5 and 4.4);
\draw[blue, thick, scale=0.8,name path=C] ($(e)-(5.4,0)$) arc(180:270:5.5 and 4.4);
% main locus + S dotted line
\path[name path=S] (O) -- (45:6);
\path[name intersections={of=B and S, by={s}}];
\coordinate[left =of s -| O] (s1);
\coordinate[below=of s |- O] (s2);
\draw[red,thick] let \p1 = ($(s)-(O)$),
\n1 = {veclen(\x1,\y1)} in
($(O)+(\n1,0)$) arc(0:90:\n1);
\draw[densely dotted] (s1) -| (s2) node [pos=0.25,above] {$S$};
\node[dot,at=(s),pin=60:{$F(S,d)$}];
% auxilary axis
\draw[densely dashed] (Y -| d) |- ([xshift=2cm] X |- d);
\node[dot,at=(d),label=below left:$d$];
% hyperbola comments
\node[align=left,right] (comment) at (5,4) {equilateral hyperbolas\\ with $d$ as the origin};
\path[name path=D] (s2) -- (15:8);
\draw[name intersections={of=A and D, by={h1}},line] (comment.210) -- (h1);
\draw[name intersections={of=B and D, by={h2}},line] (comment.210) -- (h2);
\draw[name intersections={of=C and D, by={h3}},line] (comment.210) -- (h3);
\end{tikzpicture}
\end{document}
红色弧的半径是通过与坐标的 45 度斜率的交点计算得出的O
。交点命名为,其到和轴s
的投影确定了虚线的起点和终点。y
x
双曲线是用xradius=5.5
和近似的湾弧yradus=4.4
。代码中的注释指示图像的每个元素。通过它们,代码是结构化的,也应该可以澄清代码,希望如此 :)