![Círculo unitario combinado con ángulos.](https://rvso.com/image/281603/C%C3%ADrculo%20unitario%20combinado%20con%20%C3%A1ngulos..png)
Intenté hacer un círculo unitario para explicar los ángulos, pero el círculo no está en el lugar correcto dentro de los ejes definidos. ¿Estoy usando el método incorrecto? ¿O no puedo usar la definición del eje como en el código? También quiero que la intersección del segmento y el círculo defina el sen y el cos del ángulo (pero eso creo que lo encontraré más adelante con el tkz-euclide)
Mi código:
\documentclass[11pt,a4paper]{article} % use larger type; default would be 10pt
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all} %% om allerhande objecten te gebruiken zoals gradenboog...
\usetikzlibrary{calc,intersections,through,backgrounds,snakes}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{statistics}
\begin{document}
\begin{tikzpicture}
\begin{axis}%
[
grid=major,
x=50mm,
y=50mm,
xmin=-1.1, xmax=1.1,
xtick={-1,0,1},
minor xtick={-1,-0.9,...,1},
xminorgrids = true,
xlabel={\tiny $x$},
axis x line=middle,
ymin=-1.1, ymax=1.1,
ytick={-1,0,1},
minor ytick={-1,-0.9,...,1},
yminorgrids = true,
ylabel={\scriptsize $y$},
axis y line=middle,
no markers,
samples=100,
]
\draw[blue] (axis cs:0,0) circle[radius=1];
\end{axis}
\tkzDefPoint(0,0){A}
\tkzDrawCircle[R](A,5cm)
\tkzDefPoint[shift={(0,0)}](0:5.2){B}
\tkzDefPoint[shift={(0,0)}](50:5.2){C}
\tkzDefPoint[shift={(0,0)}](130:5.2){D}
\tkzDrawSegments[color = red, line width = 1pt](A,B A,C)
\tkzDrawSegments[color = blue, line width = 1pt](A,B A,D)
\tkzDrawPoints(A) \tkzLabelPoints(A)
\tkzMarkAngle[fill= blue,size=2.5cm, opacity=.4](B,A,D);
\tkzMarkAngle[fill= red,size=1.5cm, opacity=.7](B,A,C);
\tkzFindAngle(B,A,C) \tkzGetAngle{angleBAC};
\FPround\angleBAC\angleBAC{0}
\tkzLabelAngle[pos = 1](B,A,C){\angleBAC$^\circ$ };
\tkzFindAngle(B,A,D) \tkzGetAngle{angleBAD};
\FPround\angleBAD\angleBAD{0}
\tkzLabelAngle[pos = 2](B,A,D){\angleBAD$^\circ$ };
\end{tikzpicture}
\end{document}
También tengo el problema cuando el ángulo > 180 da el ángulo incorrecto, porque \tkzGetAngle solo funciona en el intervalo -180° +180°.
Respuesta1
En cierto modo haces tres preguntas bastante diferentes. Por el primero:
De forma predeterminada, el anchor
eje de un pgfplots
eje está establecido en south west
y la posición está establecida (0,0)
en el sistema de coordenadas de tikzpicture
. Puedes cambiar la posición con at={(x,y)}
, pero como tu círculo está configurado, (0,0)
eso no es necesario. Sólo necesitas agregar anchor=center
a las axis
opciones.
Para el segundo:
Para obtener la intersección entre los segmentos de línea y el círculo puedes usar
\tkzInterLC[R](A,C)(A,5cm)\tkzGetSecondPoint{CC}
\tkzInterLC[R](A,D)(A,5cm)\tkzGetSecondPoint{DC}
CC
y DC
son las intersecciones. En el siguiente código, dibujé y etiqueté esos puntos, pero no dibujé las líneas correspondientes al seno y el coseno.
\documentclass[11pt]{standalone} % use larger type; default would be 10pt
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all} %% om allerhande objecten te gebruiken zoals gradenboog...
\usetikzlibrary{calc,intersections,through,backgrounds,snakes}
\usepackage{pgfplots}
\pgfplotsset{compat=1.8}
\usepgfplotslibrary{statistics}
\begin{document}
\begin{tikzpicture}
\begin{axis}%
[
anchor=center, % sets axis anchor to the axis origin
grid=major,
x=50mm,
y=50mm,
xmin=-1.1, xmax=1.1,
xtick={-1,0,1},
minor xtick={-1,-0.9,...,1},
xminorgrids = true,
xlabel={\tiny $x$},
axis x line=middle,
ymin=-1.1, ymax=1.1,
ytick={-1,0,1},
minor ytick={-1,-0.9,...,1},
yminorgrids = true,
ylabel={\scriptsize $y$},
axis y line=middle,
no markers,
samples=100,
]
\draw[blue] (axis cs:0,0) circle[radius=1];
\end{axis}
\tkzDefPoint(0,0){A}
\tkzDrawCircle[R](A,5cm)
\tkzDefPoint[shift={(0,0)}](0:5.2){B}
\tkzDefPoint[shift={(0,0)}](50:5.2){C}
\tkzDefPoint[shift={(0,0)}](130:5.2){D}
\tkzDrawSegments[color = red, line width = 1pt](A,B A,C)
\tkzDrawSegments[color = blue, line width = 1pt](A,B A,D)
% Finds the intersections of segments and circle
\tkzInterLC[R](A,C)(A,5cm)\tkzGetSecondPoint{CC}
\tkzInterLC[R](A,D)(A,5cm)\tkzGetSecondPoint{DC}
% draw and label points
\tkzDrawPoints(A,CC,DC) \tkzLabelPoints(A,CC,DC)
\tkzMarkAngle[fill= blue,size=2.5cm, opacity=.4](B,A,D);
\tkzMarkAngle[fill= red,size=1.5cm, opacity=.7](B,A,C);
\tkzFindAngle(B,A,C) \tkzGetAngle{angleBAC};
\FPround\angleBAC\angleBAC{0}
\tkzLabelAngle[pos = 1](B,A,C){\angleBAC$^\circ$ };
\tkzFindAngle(B,A,D) \tkzGetAngle{angleBAD};
\FPround\angleBAD\angleBAD{0}
\tkzLabelAngle[pos = 2](B,A,D){\angleBAD$^\circ$ };
\end{tikzpicture}
\end{document}