각도 계산

각도 계산

한 번 더, 제가 제대로 이해하지 못한 것 같은 수치가 있습니다. 원하는 출력은 다음과 같습니다.

여기에 이미지 설명을 입력하세요

이것이 내가 지금까지 얻은 것입니다:

여기에 이미지 설명을 입력하세요

그리고 이것은 내가 얻는 것을 생성하는 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시작점이 (-0.5,0.5)에 (P)+(\n1,0)있으므로 x축 위에서 0.5를 시작합니다 . P또한 해당 지점에서 시계 반대 방향으로 곡선을 그려 축까지 확장할 수 있습니다. 즉,

\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과 가 다음 MWE 쇼보다 arcus의 이름 인 경우 T이를 수행하는 방법:

\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}

여기에 이미지 설명을 입력하세요

관련 정보