远离英寸中心的角度位置

远离英寸中心的角度位置

$\phi$ 的位置正好位于中心,而我希望它位于圆弧的稍上方,有什么办法可以解决吗?

 \usepackage{tikz}
 \usetikzlibrary{angles, arrows.meta,   
            quotes}                
  \usepackage{siunitx}    
   \usepackage{xcolor}
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
\usepackage{tikz-3dplot}
            

\begin{document}
\tdplotsetmaincoords{60}{110}
\pgfmathsetmacro{\rvec}{.8}
\pgfmathsetmacro{\thetavec}{30}
\pgfmathsetmacro{\phivec}{80}


\begin{tikzpicture}[scale=5,tdplot_main_coords,ang/.style = {draw, Straight Barb-Straight Barb, anchor=center,label distance=20pt,angle radius = 8mm, angle eccentricity=1},arr/.style = {cap=round,-Straight Barb},]
\coordinate (O) at (0,0,0);
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}

\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};

 
\draw[-stealth,color=myblue] (O) -- (P);
\tdplotsetcoord{P2}{0.9}{60}{80}
\draw[-stealth,color=myblue] (O) -- (P2);
\tdplotsetcoord{P3}{0.6}{60}{80}
\pic [ang, "$\phi$"] {angle = P2--O--P};

\tdplotsetcoord{P5}{0.4*sqrt(3)}{60}{80}
\draw[-stealth,color=red, dashed] (O) -- (P5);




\end{tikzpicture}

\end{document}

答案1

在此处输入图片描述

您可以使用 -

\pic [ draw,"$\phi$",<->,angle radius=1cm] {angle = P2--O--P};

或者

在此处输入图片描述

\pic [ draw,"$\phi$",<->,angle radius=1cm, angle eccentricity=1.2] {angle = P2--O--P};

答案2

我实际上可以通过将角度偏心率改为 1.25 来解决这个问题

\usepackage{tikz}
 \usetikzlibrary{angles, arrows.meta,   
            quotes}                
  \usepackage{siunitx}    
   \usepackage{xcolor}
\definecolor{lava}{rgb}{0.81, 0.06, 0.13}
\definecolor{myblue}{rgb}{0.0, 0.30, 0.60}
\usepackage{tikz-3dplot}
            

\begin{document}
\tdplotsetmaincoords{60}{110}
\pgfmathsetmacro{\rvec}{.8}
\pgfmathsetmacro{\thetavec}{30}
\pgfmathsetmacro{\phivec}{80}


\begin{tikzpicture}[scale=5,tdplot_main_coords,ang/.style = {draw, Straight Barb-Straight Barb, anchor=center,label distance=20pt,angle radius = 8mm, angle eccentricity=1.25},arr/.style = {cap=round,-Straight Barb},]
\coordinate (O) at (0,0,0);
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}

\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$z$};

 
\draw[-stealth,color=myblue] (O) -- (P);
\tdplotsetcoord{P2}{0.9}{60}{80}
\draw[-stealth,color=myblue] (O) -- (P2);
\tdplotsetcoord{P3}{0.6}{60}{80}
\pic [ang, "$\phi$"] {angle = P2--O--P};

\tdplotsetcoord{P5}{0.4*sqrt(3)}{60}{80}
\draw[-stealth,color=red, dashed] (O) -- (P5);




\end{tikzpicture}

\end{document}

相关内容