Não entendo por que os valores não são calculados corretamente. O que está errado? Os ângulos (início e fim) de ambas as setas devem ser iguais.
\documentclass[10pt]{article}
\usepackage[a4paper,top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc,arrows.meta,bending,decorations.text,positioning}
\def\centerarct[#1](#2)(#3:#4:#5)% Syntax: [draw options] (center) (start angle:end angle:radius)
{ \path[#1] ($(#2)+({#5*cos(-#3+90)},{#5*sin(-#3+90)})$) arc [start angle={-#3+90}, end angle={-#4+90}, radius=#5)]; }
\def\vectorl[#1](#2)(#3:#4:#5:#6)% Syntax: [draw options] (center) (total:start:end:radius)
{ \centerarct[#1](#2)({#5/#3*360}:{(#4-1)/#3*360+360}:#6); }
\begin{document}
\begin{tikzpicture}
\vectorl[draw=yellow!75!white,line width=5mm](0,0)(2500:1:2500:4.75);
\centerarct[{Triangle[width=9mm,length=5mm]}-,scale=1.175,draw=violet!75!white,line width=5mm, postaction={decorate,decoration={text along path,text align={center,left indent=2.5mm},text={Test},raise=-1.25mm}}](0,0)(345.6:374.4:4.75);
\vectorl[{Triangle[width=9mm,length=5mm]}-,scale=1.4,draw=violet!75!white,line width=5mm, postaction={decorate,decoration={text along path,text align={center,left indent=2.5mm},text={Test},raise=-1.25mm}}](0,0 )(2500:101:2400:4.75);
\end{tikzpicture}
\end{document}
Responder1
Como você tem, por exemplo, start angle={-#3+90}
em \centerarct
, você precisa de um par extra de parênteses na definição de \vectorl
, caso contrário você obterá -x+360+90
, em vez de -(x+360)+90
. Ou seja, você precisa {((#4-1)/#3*360+360)}
.
Devido à forma como as coisas são definidas, você precisa trocar a ordem dos valores de início/fim para o círculo amarelo.
\documentclass[10pt]{article}
\usepackage[a4paper,top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc,arrows.meta,bending,decorations.text,positioning}
\def\centerarct[#1](#2)(#3:#4:#5)% Syntax: [draw options] (center) (start angle:end angle:radius)
{ \path[#1] ($(#2)+({#5*cos(-#3+90)},{#5*sin(-#3+90)})$) arc [start angle={-#3+90}, end angle={-#4+90}, radius=#5)]; }
\def\vectorl[#1](#2)(#3:#4:#5:#6)% Syntax: [draw options] (center) (total:start:end:radius)
{ \centerarct[#1](#2)({#5/#3*360}:{((#4-1)/#3*360+360)}:#6); }
\begin{document}
\begin{tikzpicture}
\vectorl[draw=yellow!75!white,line width=5mm](0,0)(2500:2500:1:4);
\centerarct[{Triangle[width=9mm,length=5mm]}-,draw=violet!75!white,line width=5mm, postaction={decorate,decoration={text along path,text align={center,left indent=2.5mm},text={Test},raise=-1.25mm}}](0,0)(345.6:374.4:5);
\vectorl[{Triangle[width=9mm,length=5mm]}-,draw=violet!75!white,line width=5mm, postaction={decorate,decoration={text along path,text align={center,left indent=2.5mm},text={Test},raise=-1.25mm}}](0,0)(2500:101:2400:6);
\end{tikzpicture}
\end{document}