当我们放大蓝色圆弧时,曲线不是直的,我该如何解决这个问题? 另外我怎样才能在如下所示的绿色区域中绘画?
\documentclass[10pt]{article}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{textcomp}
\usepackage{mathtools}
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{pstricks-add}
\usepackage{pgfplots}
\usepackage{background}
\usepackage{tkz-euclide}
\begin{document}
\definecolor{qqqqff}{rgb}{0.,0.,1.}
\definecolor{ffqqff}{rgb}{1.,0.,1.}
\definecolor{ffxfqq}{rgb}{1.,0.4980392156862745,0.}
\definecolor{qqwuqq}{rgb}{0.,0.39215686274509803,0.}
\definecolor{ffqqqq}{rgb}{1.,0.,0.}
\definecolor{ffffff}{rgb}{1.,1.,1.}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.8143322475570032cm,y=0.8064516129032259cm]
\clip(-3.,-3.07) rectangle (3.14,3.13);
\draw[line width=0.pt,color=ffxfqq,fill=ffxfqq,fill opacity=1.0] (0.2,0.2) -- (0.,0.4) -- (-0.2,0.2) -- (0.,0.) -- cycle;
\draw[line width=0.pt,color=ffxfqq,fill=ffxfqq,fill opacity=1.0] (1.4142135623730951,0.28284271247461906) -- (1.131370849898476,0.28284271247461906) -- (1.131370849898476,0.) -- (1.4142135623730951,0.) -- cycle;
\draw [line width=0.4pt,dash pattern=on 1pt off 1pt] (0.,1.4142135623730951)-- (1.4142135623730951,1.4142135623730951);
\draw [line width=0.4pt,dash pattern=on 1pt off 1pt] (1.4142135623730951,1.4142135623730951)-- (1.4142135623730951,0.);
\draw [line width=1.2pt,color=ffqqqq] (0.7071067811865476,0.7071067811865476) ellipse (0.8143322475570034cm and 0.8064516129032261cm);
\draw [line width=1.2pt,color=qqwuqq] (-1.4142135623730954,1.414213562373095)-- (1.4142135623730954,-1.414213562373095);
\draw [line width=0.4pt,dash pattern=on 1pt off 1pt] (-1.4142135623730954,1.414213562373095)-- (0.,1.4142135623730951);
\draw [line width=0.4pt,dash pattern=on 1pt off 1pt] (1.4142135623730951,0.)-- (1.4142135623730954,-1.414213562373095);
\draw [line width=1.2pt] (1.4142135623730951,1.4142135623730951)-- (0.,0.);
\draw [line width=1.2pt] (-0.21815003714678882,1.0864480788693482)-- (-1.8505136366666728,0.7586825953656016);
\draw [line width=1.2pt] (-3.,0.)-- (3.,0.);
\draw [line width=1.2pt] (0.,3.)-- (0.,-3.);
\draw [shift={(0.,0.)},line width=1.2pt,color=ffqqff] plot[domain=0.7853981633974483:2.356194490192345,variable=\t]({1.*2.*cos(\t r)+0.*2.*sin(\t r)},{0.*2.*cos(\t r)+1.*2.*sin(\t r)});
\draw [shift={(0.,0.)},line width=1.2pt,color=qqqqff] plot[domain=2.356194490192345:5.497787143782138,variable=\t]({1.*2.*cos(\t r)+0.*2.*sin(\t r)},{0.*2.*cos(\t r)+1.*2.*sin(\t r)});
\draw [shift={(0.,0.)},line width=1.2pt,color=ffxfqq] plot[domain=-0.7853981633974483:0.7853981633974483,variable=\t]({1.*2.*cos(\t r)+0.*2.*sin(\t r)},{0.*2.*cos(\t r)+1.*2.*sin(\t r)});
\begin{scriptsize}
\draw [fill=ffffff] (1.4142135623730951,1.4142135623730951) circle (1.5pt);
\draw [fill=ffffff] (1.4142135623730951,0.) circle (1.5pt);
\draw [fill=ffffff] (0.,1.4142135623730951) circle (1.5pt);
\draw [fill=ffffff] (0.7071067811865476,0.7071067811865476) circle (1.5pt);
\draw[color=ffffff] (0.89666666666667,0.5133333333333265) node {$O$};
\draw [fill=ffffff] (-1.4142135623730954,1.414213562373095) circle (1.5pt);
\draw [fill=ffffff] (1.4142135623730954,-1.414213562373095) circle (1.5pt);
\draw [fill=black] (-1.8505136366666728,0.7586825953656016) circle (1.5pt);
\draw [fill=ffffff] (0.,0.) circle (1.5pt);
\draw [fill=black] (-0.21815003714678882,1.0864480788693482) circle (1.5pt);
\draw [fill=black,shift={(0.,3.)}] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=black,shift={(3.,0.)},rotate=270] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\end{scriptsize}
\end{tikzpicture}
\end{document}
答案1
我会用 来做这个arcs
,用于“圆圈”和绿色区域。缩放的问题在于蓝色弧线(和其他弧线)是用plot
少量样本制作的。
\documentclass[border=2mm]{standalone}
\usepackage {siunitx} % for \ang, when showing the angles, commented bottom code
\usepackage {tikz}
\usetikzlibrary{calc}
\usetikzlibrary{babel} % -> there are conflicts with tikz and some babels
\definecolor{mypink} {rgb}{1,0 ,1}
\definecolor{mygreen}{rgb}{0,0.4,0}
\begin{document}
\begin{tikzpicture}[thick,line cap=round]
% coordinates
\def\R{2} % big circle radius
\def\r{0.05} % points radii
\coordinate (O) at (0,0);
\coordinate (A) at (-45:\R);
\coordinate (B) at ( 45:\R);
\coordinate (C) at (135:\R);
\coordinate (M) at ($(B)!0.5!(O)$);
\coordinate (P) at ($(A)!0.5!(B)$);
\coordinate (Q) at ($(B)!0.5!(C)$);
\coordinate (U) at ($(M)+(165:0.5*\R)$);
\coordinate (V) at (170:\R);
% background (green and gray fillings)
\fill[gray!30] (O) arc (225:315:0.5*\R); % arc from O, starting angle 225, end angle 315 (anti-clockwise), radius 0.5*\R (1cm)
\fill[green!30!yellow] (C) arc (135:315:\R) % arc from C, starting angle 135, end angle 315 (anti-clockwise), radius \R (2cm)
-- (P) % straight angle form the end of the arc to P
arc (315:135:0.5*\R) % arc from P, starting angle 315, end angle 135 (clockwise), radius 0.5*\R (1cm)
-- cycle; % straight from the and of the arc to the first point C
% right angles
\foreach\i/\j in {O/45,P/90}
\fill[orange,rotate=\j] (\i) rectangle ($(\i)+(0.2,0.2)$);
% axes
\draw[-latex] (-1.5*\R,0) -- (1.5*\R,0);
\draw[-latex] (0,-1.5*\R) -- (0,1.5*\R);
% circles, arcs
\draw[red] (M) circle (0.5*\R);
\draw[orange] (A) arc (-45: 45:\R); % arc from A, starting angle -45, end angle 45 (anti-clockwise), radius \R (2cm)
\draw[blue] (C) arc (135:315:\R); % arc from C, starting angle 135, end angle 315 (anti-clockwise), radius \R (2cm)
\draw[mypink] (B) arc ( 45:135:\R); % arc from B, starting angle 45, end angle 135 (anti-clockwise), radius \R (2cm)
% lines
\draw[thin,dashed] (A) |- (C);
\draw[mygreen] (A) -- (C);
\draw (O) -- (B);
\draw (U) -- (V);
% points
\foreach\i in {A,B,C,M,O,P,Q}
\draw[thin,fill=white] (\i) circle (\r);
\foreach\i in {U,V}
\fill (\i) circle (\r);
% arc syntax:
% uncomment the following code, it needs the siunitx package not included in the original drawing)
% it will display are the angles needed for drawing the gray filled arc (just below the coordinates)
% \draw[thin,gray,dashed] (P) -- (M) -- ($(P)!0.5!(B)$);
% \draw[thin,brown,->] ($(M)+(0.3,0)$) arc (0:225:0.3);
% \draw[thin,cyan,->] ($(M)+(0.2,0)$) arc (0:315:0.2);
% \node[brown] at ($(M)+(0,0.4)$) {\tiny\ang{225}};
% \node[cyan] at ($(M)-(0,0.3)$) {\tiny\ang{315}};
\end{tikzpicture}
\end{document}
编辑1:添加了灰色区域并注释了弧。
编辑2:添加了语法的图示示例arc
(已注释)。它需要siuntix
显示弧测量的包。
答案2
pstricks
使用及其命令的简短解决方案\pscustom
:
\documentclass[border=6pt, svgnames]{standalone}
\usepackage{pst-eucl}%
\begin{document}
\begin{pspicture}(-3,-3)(3,3)%
\SpecialCoor
\psset{PointName=none, linejoin=1, linewidth=1.2pt, arrowinset=0}%
\pstGeonode[PointSymbol=none](0,0){O}(2;45){A}(2;135){B}(2;-45){C}%
(1; 45){O1}(0,1.414){J}(1.414,0){K}
\pscustom[linestyle=none, fillstyle=solid, fillcolor=GreenYellow!75]{%
\psline(B)(J)\pstArcOAB{O1}{J}{K}\psline(K)(C)\pstArcnOAB{O}{C}{B}}%
\psaxes[labels =none, ticks=none]{->}(0,0)(-3,-3)(3,3)
\foreach \s/\t/\color in {A/B/Magenta, C/A/Orange, B/C/Blue} {\pstArcOAB[linecolor=\color]{O}{\s}{\t}}
\pstCircleAB[linecolor=red]{O}{A}
\psline[linewidth=0.5pt, linestyle=dashed, dash=2pt 1.2pt](B)(A)(C)
\psline[linecolor =ForestGreen](B)(C)
\psdots[dotstyle=Bo](O)(A)(B)(C)(J)(K)
\pstGeonode(2; 156){I}
\pstInterLC[PointSymbolB=none]{I}{A}{O1}{A}{M}{N}
\psline(I)(M)
\end{pspicture}
\end{document}