我在 tikz 中以叠加模式绘制圆弧,但结果不是我想要的。我想要的圆弧看起来像:
我使用的代码:
\documentclass[12pt,a4paper]{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[left=2cm,right=1cm,top=2cm,bottom=2cm]{geometry}
\usepackage{tikz,xcolor,tikzpagenodes}
\usetikzlibrary{calc,arrows, patterns,patterns.meta,hobby}
\begin{document}
\definecolor{darkteal}{RGB}{16,162,163}
\begin{tikzpicture}[remember picture, overlay]
\coordinate (A) at (current page.north west);
\coordinate (A1) at ([yshift=-0.4\paperheight]current page.north west);
\coordinate (B1) at ([yshift=-0.4\paperheight]current page.north east);
\coordinate (A2) at ([yshift=-0.6\paperheight]current page.north west);
\coordinate (B2) at ([yshift=-0.6\paperheight]current page.north east);
\draw[darkteal] (B2) arc ({90+asin(0.9)}:180:20);
\end{tikzpicture}
\end{document}
谢谢大家!!
答案1
您的误解似乎是您使用的坐标arc
不是圆弧的中心点,而是圆弧的起点(中心位于其右侧 20 厘米处)。
如果你移动你的起点(例如通过在中使用相同的角度和半径++(<ang>:<radius>)
),你就会得到你想要的结果(我从你的序言中删除了不相关的包):
\documentclass[12pt,a4paper]{book}
\usepackage[left=2cm,right=1cm,top=2cm,bottom=2cm]{geometry}
\usepackage{tikz,tikzpagenodes}
\usetikzlibrary{calc,arrows, patterns,patterns.meta,hobby}
\begin{document}
\definecolor{darkteal}{RGB}{16,162,163}
\begin{tikzpicture}[remember picture, overlay]
\coordinate (A) at (current page.north west);
\coordinate (A1) at ([yshift=-0.4\paperheight]current page.north west);
\coordinate (B1) at ([yshift=-0.4\paperheight]current page.north east);
\coordinate (A2) at ([yshift=-0.6\paperheight]current page.north west);
\coordinate (B2) at ([yshift=-0.6\paperheight]current page.north east);
\draw[darkteal] (B2) ++({90+asin(0.9)}:20cm) arc ({90+asin(0.9)}:180:20cm);
\end{tikzpicture}
\end{document}