
나는 평행사변형과 두 개의 합동인 정육각형인 다음 그림을 그리고 싶습니다.
\documentclass[12pt]{article}
\usepackage{geometry}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage[portuguese]{babel}
\usepackage{tikz,tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}[scale=0.9]
\tkzInit[xmin=0,xmax=8,ymin=0,ymax=3]
\tkzClip[space=.5]
\tkzDefPoint(0,0){A} \tkzDefPoint(6,0){B}
\tkzDefPoint(7.5,3){C} \tkzDefPoint(1.5,3){D}
\tkzDefPointWith[colinear= at C](B,A)
\tkzDrawPolygon(A,B,C,D)
\end{tikzpicture}
\end{document}
답변1
육각형은 모든 각도가 60도이기 때문에 좋습니다. 즉, 중심에서 모서리까지의 거리가 모든 측면이 동일하다는 의미입니다. 나는 이것을 거리라고 부른다 \D
. 그렇다면 그것은 대부분 측면과 각도를 계산하는 문제입니다.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\newcommand\D{2}
\coordinate (A) at (0,0);
\path (A) ++(0:\D) ++(-60:\D)coordinate (B);
%%
\draw[fill=gray!50] ($(A)+(120:\D)$)
-- ($(A)+(120:\D)+(-120:3*\D)$)
-- ($(B)+(-60:\D)$)
-- ($(B)+(-60:\D)+(60:3*\D)$) -- cycle;
%% Hexagons
\draw[fill=white] (A) +(0:\D) -- +(60:\D) -- +(120:\D) -- +(180:\D) -- +(240:\D) -- +(300:\D) -- cycle;
\draw[fill=white] (B) +(0:\D) -- +(60:\D) -- +(120:\D) -- +(180:\D) -- +(240:\D) -- +(300:\D) -- cycle;
%% Where are A and B?
\draw (A) circle (1pt) node[below]{A};
\draw (B) circle (1pt) node[below]{B};
\end{tikzpicture}
\end{document}