我使用 Geogebra 绘制了如下图所示的图形:
然后我从中导出一个 TEX 文件:
\documentclass[0pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
\draw (-6.398243018635849,29.30976776220647)-- (86.80087849068208,49.65488388110324);
\draw (97.54228504819193,22.03412416179222)-- (15.084570096383837,-25.93175167641558);
\draw [shift={(0,0)}] plot[domain=1.7857219540430334:5.239245930761878,variable=\t]({1*30*cos(\t r)+0*30*sin(\t r)},{0*30*cos(\t r)+1*30*sin(\t r)});
\draw [shift={(90,35)}] plot[domain=-1.0439393764177076:1.785721954043033,variable=\t]({1*15*cos(\t r)+0*15*sin(\t r)},{0*15*cos(\t r)+1*15*sin(\t r)});
\end{tikzpicture}
\end{document}
我认为我导出时使用了错误的单位,因此图纸不适合该图纸:
我是否应该在导出之前在 Geogebra 中更正某些内容,或者更正获得的代码更有趣?
编辑
根据马苏皮兰。如何使图案位于纸张中央且宽度为 70 毫米?
答案1
这不是你的真正问题,但在 tikz 中绘制它也很有趣......
输出
代码
\documentclass[12pt,tikz]{standalone}
\begin{document}
\begin{tikzpicture}[rotate=39, scale=4]
% parameters of the shape
\def\thet{75}
\def\r{.4}
\coordinate (O) at (0,0) ;
\coordinate (a1) at ({cos(\thet)},{sin(\thet)});
\coordinate (a2) at ({cos(\thet)},{-sin(\thet)});
\coordinate (vanish) at ({sec(\thet)},0);
\path (vanish) -- (a1) coordinate[pos=\r] (b1)
(vanish) -- (a2) coordinate[pos=\r] (b2)
(vanish) -- (O) coordinate[pos=\r] (o) ;
\pgfresetboundingbox
\draw [blue, very thick, fill=red!20] (a1)
arc [start angle=\thet,end angle=360-\thet,radius=1] -- (b2)
arc [start angle=-\thet,end angle=\thet,radius=\r] -- cycle ;
\end{tikzpicture}
\end{document}
答案2
您可以通过查看剪切的矩形来计算值x
,假设这是您想要通常看到的区域。
(在这种特殊情况下,剪切是没有必要的,因为在剪切的矩形之外没有任何绘制的内容。所以您也可以查看绘制形状的外部坐标)。
x = 70 毫米 / (175.88229072982594 - (-92.2298265729806)) = 0.26 毫米
为了保持轴比,你应该设置 y = x。然后你会得到这个结果(我添加了红色矩形,以查看剪切区域):
\documentclass[0pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.26mm,y=0.26mm]
\clip(-92.2298265729806,-92.52338090781379) rectangle (175.88229072982594,94.97188107843031);
\draw[red] (-92.2298265729806,-92.52338090781379) rectangle (175.88229072982594,94.97188107843031);
\draw (-6.398243018635849,29.30976776220647)-- (86.80087849068208,49.65488388110324);
\draw (97.54228504819193,22.03412416179222)-- (15.084570096383837,-25.93175167641558);
\draw [shift={(0,0)}] plot[domain=1.7857219540430334:5.239245930761878,variable=\t]({1*30*cos(\t r)+0*30*sin(\t r)},{0*30*cos(\t r)+1*30*sin(\t r)});
\draw [shift={(90,35)}] plot[domain=-1.0439393764177076:1.785721954043033,variable=\t]({1*15*cos(\t r)+0*15*sin(\t r)},{0*15*cos(\t r)+1*15*sin(\t r)});
\end{tikzpicture}
\end{document}