我試圖使用 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
。程式碼中的註解指示圖像的每個元素。透過他們,代碼是結構化的,也應該澄清代碼,希望:)