我想绘制以下图形:
使用 连续绘制三个圆,半径分别为 2cm、3cm 和 4cm
tkz-euclide
。用 排列成一排三个等边三角形,边长分别为 2cm、3cm 和 4cm
tkz-euclide
。用 画出一排三个正方形,边长分别为 2cm、3cm 和 4cm
tikz-euclide
。
这是我目前所取得的成就:
\documentclass[12pt, letterpaper]{article}
\usepackage[
a4paper,top=1in,bottom=1in,left=0.7in,right=0.7in,headheight=14.5pt,]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (2cm);
\draw (4,0) circle (1.5cm);
\draw (6.95,0) circle (1cm);
\end{tikzpicture}
\vspace{1cm}
\begin{tikzpicture}
\draw (0,0) -- (2,0) -- (2,2) -- (0,2) -- (0,0);
\draw (3,0) -- (6,0) -- (6,3) -- (3,3) -- (3,0);
\draw (7,0) -- (11,0) -- (11,4) -- (7,4) -- (7,0);
\end{tikzpicture}
\end{document}
答案1
如果你真的想使用 tkz-euclide。在这种情况下,你可以避免调用 tikz,因为 euclide 会加载它
\documentclass[12pt]{article}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
\noindent
\begin{tikzpicture}
\foreach \d/\x/\y in {2/-2/0,3/1/0,4/5/0}{%
\tkzDefPoint(\x,\y){K}
\tkzDefShiftPoint[K](0:\d){M}
\tkzDefSquare(K,M)\tkzGetPoints{N}{O}
\tkzDrawPolygon[color=red](K,M,N,O)
\tkzLabelSegment[below](K,M){Square side=\d cm}
}
\end{tikzpicture}
\begin{tikzpicture}
\foreach \d/\x/\y in {2/-2/0,3/2/0,4/6/0}{%
\tkzDefPoint(\x,\y){J}
\tkzDefShiftPoint[J](0:\d){L}
\tkzDrawTriangle[equilateral,color=blue](J,L)
\tkzLabelSegment[below](J,L){Tr. Equ. side=\d cm}
}
\end{tikzpicture}
\begin{tikzpicture}
\foreach \d/\x/\y in {1/0/0,1.5/3.5/0,2/8/0}{%
\tkzDefPoint(\x,\y){I} \tkzDefShiftPoint[I](60:\d){T}
\tkzDrawPoints[size=4,fill=gray](I,T) \tkzDrawSegment(I,T)
\tkzDrawCircle[R,color=purple](I,\d cm)
\tkzLabelCircle[R,text width=3cm,text centered]
(I,\d cm+1cm)(-60){Circle R=\d cm}}
\end{tikzpicture}
\end{document}
答案2
像这样 :
\documentclass[12pt, letterpaper]{article}
\usepackage[
a4paper,top=1in,bottom=1in,left=0.7in,right=0.7in,headheight=14.5pt,]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (2cm);
\draw (4,0) circle (1.5cm);
\draw (6.95,0) circle (1cm);
\end{tikzpicture}
\vspace{1cm}
\begin{tikzpicture}
\draw (0,0) rectangle (2,2);
\draw (3,0) rectangle (6,3);
\draw (7,0) rectangle (11,4);
\end{tikzpicture}
\vspace{1cm}
\begin{tikzpicture}
\draw (0cm,0cm) -- ++(0:2cm) -- ++(120:2cm) -- ++(-120:2cm);
\draw (4cm,0cm) -- ++(0:3cm) -- ++(120:3cm) -- ++(-120:3cm);
\draw (8cm,0cm) -- ++(0:4cm) -- ++(120:4cm) -- ++(-120:4cm);
\end{tikzpicture}
\end{document}