在 tikz 中传输填充的角度

在 tikz 中传输填充的角度

这是我的代码;

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}   
\draw [->, ultra thick](0,6)--(0,-6) node[right]{$x$};
\draw [->,ultra thick](6,0)--(-6,0) node[above]{$y$};
\draw (6,-2)--(-6,6);
\draw (6,6)--(-6,-2);
\fill[green!20!white] (3,0)--(5mm,0mm)
arc[start angle=0, end angle=143.130102, radius=4mm]--(0,0);
\end{tikzpicture}

\end{document}

正如我在图片中所展示的,我想将填充的角度转移到箭头所指的位置。

答案1

使用 + 或 ++ 进行相对更改,并且填充应始终在起点结束(如果您想控制路径)。

\documentclass{article}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}   
\draw [->, ultra thick](0,6)--(0,-6) node[right]{$x$};
\draw [->,ultra thick](6,0)--(-6,0) node[above]{$y$};
\draw (6,-2)--(-6,6);
\draw (6,6)--(-6,-2);
\fill[green!20!white] (3,0)-- ++(4mm,0mm)
arc[start angle=0, end angle=143.130102, radius=4mm]--cycle;
\end{tikzpicture}

\end{document}

答案2

在此处输入图片描述

\documentclass{article}
\usepackage{tikz,siunitx}
\usetikzlibrary{%
    calc,
    intersections,
    backgrounds,
    quotes,
    angles,
}

\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}

\begin{document}

\begin{tikzpicture}

\draw[->,ultra thick](0,-6)--(0,6) node[right]{$y$} ;
\draw[->,ultra thick,name path=P1](-6,0)--(6,0)
                coordinate (A)
                node[above] {$x$} ;

\draw[name path=P2] (6,-2)--(-6,6) coordinate (C);
\draw (6,6)--(-6,-2);

\path[name intersections={of= P1 and P2,by=B}] ;

\begin{pgfonlayer}{background}
\draw pic[%
    fill=green,
    "\ang{150}",
    angle eccentricity=1.3,
    angle radius=1cm
    ] {angle=A--B--C} ; 
\end{pgfonlayer}

\end{tikzpicture}
\end{document}

答案3

在此处输入图片描述

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}

\begin{document}

\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\draw[->,color=black] (-3.1,0.) -- (4.5,0.);
\foreach \x in {-3.,-2.,-1.,1.,2.,3.,4.}
\draw[shift={(\x,0)},color=black] (0pt,2pt) -- (0pt,-2pt) node[below] {\footnotesize $\x$};
\draw[->,color=black] (0.,-2.18) -- (0.,3.22);
\foreach \y in {-2.,-1.,1.,2.,3.}
\draw[shift={(0,\y)},color=black] (2pt,0pt) -- (-2pt,0pt) node[left] {\footnotesize $\y$};
\draw[color=black] (0pt,-10pt) node[right] {\footnotesize $0$};
\clip(-3.12,-2.18) rectangle (4.48,3.22);
\draw [shift={(1.5,0.)},line width=2.pt,color=red,fill=red,fill opacity=0.1] (0,0) -- (0.:0.6) arc (0.:139.95325747784204:0.6) -- cycle;
\draw [line width=2.pt,domain=-3.12:4.48] plot(\x,{(--4.0372-2.74*\x)/3.26});
\begin{scriptsize}
\draw[color=black] (-4.14,4.53) node {$f$};
\draw[fill=black] (1.5,0.) circle (2.0pt);
\end{scriptsize}
\end{tikzpicture}
\end{document}

相关内容