
나는 서로 다른 모서리에 직각이 있는 다양한 사각형을 그릴 수 있기를 원합니다. 상대 좌표를 사용하려고 시도했지만 실패했습니다. 여기 내 MWE가 있습니다. 나는 또한 직각을 사용하려고 노력했습니다 -| 그리고 실패했습니다.
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{tkz-euclide}% this needed for markings on trianlges with red markings
\usetikzlibrary{shapes,shapes.multipart}
\thispagestyle{empty}
\begin{document}
\begin{tikzpicture}
\draw [help lines] (-3,-3) grid (2,2);
\draw[green,fill=green] (0,0) circle (.5ex);
\draw [color=blue, very thick] (-1,-3) -- (-3,0) -- (-1,2) -- (-30:2cm) --cycle;
\draw [very thick, color= red] (-1.3,1.75) -- (-1,1.4)-- (-0.8,1.8) ;
\end{tikzpicture}
\end{document}
답변1
해결책
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
%\usepackage{tkz-euclide}% this needed for markings on trianlges with red markings
\usetikzlibrary{shapes,shapes.multipart}
\thispagestyle{empty}
\begin{document}
\begin{tikzpicture}
\path[thick,blue] (2,0)coordinate(A) -- (4.5,-3)coordinate(B);
\coordinate(C) at ($(B)!2.5cm!90:(A)$) ;
\coordinate(D) at ($(A)!3cm!-70:(B)$) ;
\draw[thick,blue] (A) -- (B) -- (C) -- (D) -- cycle;
\draw pic[draw,fill=green!30,angle radius=1cm,"$\theta$" shift={(1mm,1mm)}] {angle=A--B--C};
\draw (0,0) grid (5,-5);
\end{tikzpicture}
\end{document}