교차점에서 Tikz 트림 라인

Nov 29 2020

저는 "파라 메트릭"직각 삼각형을 그리는 방법을 생각하고 있습니다. 즉, 빗변의 길이 \hypo와 내부 각도 중 하나를 변경 \alfa하면 삼각형이 그려집니다. 지금까지 나는 이것을했다

\documentclass[border=1mm]{standalone}

\usepackage{tikz}

\usetikzlibrary{calc, angles, intersections}

\begin{document}
    \begin{tikzpicture}
        \def\alfa{55}
        \def\hypo{3}
        \draw[name path= A-C] (0,0) node[below left] (A) {A} -- (90-\alfa:3);
        \draw (0,0) -- (\hypo,0) node[below right] (B) {B} -- ++ (180-\alfa:3);
        \path[name path= B-C] (\hypo,0) -- ++ (180-\alfa:3);
        \node [name intersections={of= A-C and B-C}, above] at (intersection-1) {C};
    \end{tikzpicture}
\end{document}

교차로에서 두 개의 카테 티를 다듬는 방법을 알 수 없습니다.

게다가 길이 (여기서는 3 단위)를 하드 코딩하는 것은 좋지 않다고 생각합니다. 너무 짧으면 교차하지 않고 Tikz가 교차로를 찾을 수 없기 때문에 그렇게했습니다. LaTeX (또는 Tikz)가 교차로에 도달하기 위해 올바른 길이를 알아 내고 통과하지 못하도록하는 것이 좋습니다. 매뉴얼과 온라인에서 해결책을 찾으려고했지만 정말 도움이되는 것이 없습니다. 이 작업을 수행하는 방법을 아십니까?

답변

5 Noname Nov 29 2020 at 01:50

overlay경계 상자에서 보조 좌표를 제외 하는 데 사용할 수 있습니다 . BTW, intersections직선 사이의 교차점을 계산하는 데 라이브러리 가 필요하지 않습니다 .

\documentclass[border=1mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
   \def\alfa{55}
   \def\hypo{3}
   \path[overlay] (0,0) coordinate (A) ++ (90-\alfa:1) coordinate (C')
    (\hypo,0) coordinate (B)  ++ (180-\alfa:1) coordinate (C'')
    (intersection of A--C' and B--C'') coordinate (C);
    %or
    %(intersection cs:first line={(A)--(C')},second line={(B)--(C'')}) coordinate (C);
   \draw (A) node[below left]  {$A$}    -- (B) node[below right] {$B$}
    -- (C) node[above]{$C$} -- cycle;
\end{tikzpicture}
\end{document}

물론 C의 좌표를 분석적으로 계산할 수 있습니다 . 예를 들어 this thread 참조하십시오 .