Al fin después de tanto batallar ya encontramos la respuesta de esta incógnita que muchos usuarios de nuestro espacio han tenido. Si deseas aportar alguna información puedes compartir tu comentario.
Solución:
¡Bienvenidos! Hay dos problemas: cuando configura un sistema de coordenadas tangente en otro sistema de coordenadas tangente, toma una rotación adicional. Por lo tanto, creé el segundo sistema tangente en una línea que usa el sistema de coordenadas original. Además, los ángulos de entrada y salida son absolutos, por lo que debe agregar el ángulo de rotación del cuadro actual.
documentclass[a4paper,12pt]article
usepackagetikz
usetikzlibrarycalc
usetikzlibraryintersections
usetikzlibrarydecorations.markings
tikzset
tangent pos/.style=decoration=markings, mark = at position #1 with
coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);
,
postaction=decorate
,
%
tangent/.style=shift=(tangent point-#1), x=(tangent unit vector-#1), y=(tangent orthogonal unit vector-#1),
newcommand*tpointmark[2][]fill [smooth,fill=black#1] (#2) circle (0.05)
begindocument
beginfigure [!htbp]
centering
begintikzpicture [font=footnotesize]
draw [thick,<->] (0,5) node[above]$Y$ -- (0,0) node[below left]$0$ coordinate (axis1) -- (5,0) node[right]$X$;
draw [smooth,red,thick,tangent pos=0.3] (0,4.5) to[out=0, in=90] (3.5,0);
draw [smooth,black,tangent=1,tangent pos=0.8] (-1,0) -- coordinate[pos=0.8] (A) (4,0);
draw [smooth,blue,thick] (3.85,2.95) to[out=270, in=180] (4.85,1.95);
tpointmarkA;
endtikzpicture
qquad
begintikzpicture [font=footnotesize]
draw [thick,<->] (0,5) node[above]$Y$ -- (0,0) node[below left]$0$ coordinate (axis1) -- (5,0) node[right]$X$;
draw [smooth,red,thick,tangent pos=0.3] (0,4.5) to[out=0, in=90] (3.5,0);
draw [black,tangent=1] (-1,0) coordinate (A0) -- coordinate[pos=0.8] (A)
(4,0) coordinate (A1);
path [tangent pos=0.8] (A0) -- (A1);
draw [smooth,blue,thick,tangent=1]
let p1=($(1,0)-(0,0)$),
n1=atan2(y1,x1) in
(-1,0.5) to[out=-45+n1,in=180+n1]
(0,0) to[out=0+n1,in=-135+n1] (1,0.5);
tpointmarkA;
endtikzpicture
endfigure
enddocument
Puede evitar esto, en lugar de establecer los vectores unitarios del marco local simplemente buscando la rotación que lo lleva allí. Para el ejemplo actual, esto facilita las cosas, pero también hay desventajas porque si ahora dices transform shape
los textos de los nodos se rotarán.
documentclass[a4paper,12pt]article
usepackagetikz
usetikzlibrarycalc
usetikzlibraryintersections
usetikzlibrarydecorations.markings
tikzset
tangent pos/.style=decoration=markings, mark = at position #1 with
coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);
,
postaction=decorate
,
%
tangent/.style=shift=(tangent point-#1),
insert path=let p1=($(tangent unit vector-#1)-(tangent point-#1)$),
n1=atan2(y1,x1) in [rotate=n1]
%x=(tangent unit vector-#1), y=(tangent orthogonal unit vector-#1)
,
newcommand*tpointmark[2][]fill [smooth,fill=black#1] (#2) circle (0.05)
begindocument
beginfigure [!htbp]
centering
begintikzpicture [font=footnotesize]
draw [thick,<->] (0,5) node[above]$Y$ -- (0,0) node[below left]$0$ coordinate (axis1) -- (5,0) node[right]$X$;
draw [smooth,red,thick,tangent pos=0.3] (0,4.5) to[out=0, in=90] (3.5,0);
draw [smooth,black,tangent=1,tangent pos=0.8] (-1,0) -- coordinate[pos=0.8] (A) (4,0);
draw [smooth,blue,thick] (3.85,2.95) to[out=270, in=180] (4.85,1.95);
tpointmarkA;
endtikzpicture
qquad
begintikzpicture [font=footnotesize]
draw [thick,<->] (0,5) node[above]$Y$ -- (0,0) node[below left]$0$ coordinate (axis1) -- (5,0) node[right]$X$;
draw [smooth,red,thick,tangent pos=0.3] (0,4.5) to[out=0, in=90] (3.5,0);
draw [black,tangent=1,tangent pos=0.8] (-1,0) -- coordinate[pos=0.8] (A)
(4,0);
draw [smooth,blue,thick,tangent=1] (-1,0.5) to[out=-45,in=180]
(0,0) to[out=0,in=-135] (1,0.5);
tpointmarkA;
endtikzpicture
endfigure
enddocument
Finalmente, aquí no necesita un sistema de coordenadas tangente explícito. Puede definir una imagen que no sea más que un envoltorio de algún código. Si utiliza sloped
y transform shape
también te llevará al espacio tangente.
documentclass[a4paper,12pt]article
usepackagetikz
usetikzlibrarycalc
usetikzlibraryintersections
usetikzlibrarydecorations.markings
tikzset
tangent pos/.style=decoration=markings, mark = at position #1 with
coordinate (tangent point-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,0pt);
coordinate (tangent unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (1,0pt);
coordinate (tangent orthogonal unit vector-pgfkeysvalueof/pgf/decoration/mark info/sequence number) at (0pt,1);
,
postaction=decorate
,
%
tangent/.style=shift=(tangent point-#1),
insert path=let p1=($(tangent unit vector-#1)-(tangent point-#1)$),
n1=atan2(y1,x1) in [rotate=n1]
%x=(tangent unit vector-#1), y=(tangent orthogonal unit vector-#1)
,
pics/whatever/.style=code=#1
newcommand*tpointmark[2][]fill [smooth,fill=black#1] (#2) circle (0.05)
begindocument
beginfigure [!htbp]
centering
begintikzpicture [font=footnotesize]
draw [thick,<->] (0,5) node[above]$Y$ -- (0,0) node[below left]$0$ coordinate (axis1) -- (5,0) node[right]$X$;
draw [smooth,red,thick,tangent pos=0.3] (0,4.5) to[out=0, in=90] (3.5,0);
draw [smooth,black,tangent=1,tangent pos=0.8] (-1,0) -- coordinate[pos=0.8] (A) (4,0);
draw [smooth,blue,thick] (3.85,2.95) to[out=270, in=180] (4.85,1.95);
tpointmarkA;
endtikzpicture
qquad
begintikzpicture [font=footnotesize]
draw [thick,<->] (0,5) node[above]$Y$ -- (0,0) node[below left]$0$ coordinate (axis1) -- (5,0) node[right]$X$;
draw [smooth,red,thick,tangent pos=0.3] (0,4.5) to[out=0, in=90] (3.5,0);
draw [black,tangent=1] (-1,0) -- coordinate[pos=0.8] (A)
(4,0) pic[sloped,pos=0.8,transform shape]whatever=draw [smooth,blue,thick] (-1,0.5) to[out=-45,in=180]
(0,0) to[out=0,in=-135] (1,0.5);;
tpointmarkA;
endtikzpicture
endfigure
enddocument
Mismo resultado que antes.