单位圆与角的结合

单位圆与角的结合

我尝试制作一个单位圆来解释角度,但圆不在定义的轴内的正确位置。我使用的方法不对吗?或者我不能像代码中那样使用轴定义。我还想让线段和圆的交点定义角度的正弦和余弦(但我想我稍后会用 tkz-euclide 找到它)

我的代码:

\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}

我也遇到这个问题,当角度 > 180 时,它会给出错误的角度,因为 \tkzGetAngle 仅在区间 -180° +180° 内有效。

单位圆

答案1

你问的是三个完全不同的问题。第一个问题:

默认情况下,轴anchorpgfplots设置为,位置在坐标系中south west设置为。您可以使用更改位置,但由于您的圆设置在周围,因此没有必要。您只需添加到选项中即可。(0,0)tikzpictureat={(x,y)}(0,0)anchor=centeraxis

对于第二个:

要获得线段和圆之间的交点,您可以使用

\tkzInterLC[R](A,C)(A,5cm)\tkzGetSecondPoint{CC} 
\tkzInterLC[R](A,D)(A,5cm)\tkzGetSecondPoint{DC}

CCDC是交点。在下面的代码中,我绘制并标记了这些点,但我没有绘制与正弦和余弦相对应的线。

在此处输入图片描述

\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}

相关内容