答案1
该命令\trigfuns[<scale>]{<angle>}{<label>}
将生成所需的图像。可选参数是整个图形的比例因子。默认值为 1,将生成半径为 1cm 的圆。
角度以度为单位。小于 20 或大于 60,标签就会开始变形。
在上图中,第二张图使用 制作\trigfuns[2]{40}{x}
,这是一个 40° 角,标记为x
,第三张图使用\trigfuns[2]{50}{50^{\circ}}
。
标签以数学模式解析。代码如下:
\documentclass{article}
\usepackage{tikz}
%\usetikzlibrary{positioning}
\newcommand{\trigfuns}[3][1]% #1 is scale factor (default=1), #2 is angle
{\begin{tikzpicture}[scale=#1, semithick, every node/.style={circle, inner sep=.1mm, font=\scriptsize}]
\draw (0,0) circle[radius=1];
\draw (0,0) -- (#2:{max(sec(#2),cosec(#2))});
\draw (0,0) -- (0,1) -- ({cot(#2)},1)node [label={[above, midway]$\theta$}] {};
\draw (0,0) -- (1,0) -- (1,{tan(#2)})node [label={[right, midway]$w$}] {};
\draw ({cos(#2)},0) -- ({cos(#2)},{sin(#2)})node [label={[left,midway]$s$}] {}
-- (0, {sin(#2)})node [label={[above,midway]$t$}] {};
\node at ({.5*cos(#2)},{.5*sin(#2)}) [label=#2+90:$1$] {};
\draw (0:.3) arc (0:#2:.3)node [label={[yshift=.3mm,right,midway]$#3$}] {};
\end{tikzpicture}}
\begin{document}
\trigfuns[2]{30}{\frac{\pi}{6}}\hspace{-3mm}\trigfuns[2]{40}{x}\qquad\trigfuns[2]{50}{50^{\circ}}
\end{document}
答案2
由于您正在使用 Overleaf,因此可以使用 TikZ 的替代方案(PSTricks、Metapost、Asymptote)。如果您考虑给它一个机会,这里有一个使用 Metapost 的可能性:
\documentclass{article}
\usepackage[shellescape,latex]{gmp}
\newcommand{\nicecircle}[2]{%
\begin{mpost}[name=circle]%
vardef nicecircle(expr unit, Angle) =
image(
%Circle
path C; C := fullcircle scaled (2*unit);
pair P[];
%Radius
P[1] := dir(Angle)*unit;
%Some other points
P[2] := P[1] scaled (1/cosd(Angle));
P[3] := P[1] scaled (1/sind(Angle));
P[4] := (xpart P[1], 0);
P[5] := (0, ypart P[1]);
draw C;
draw origin -- P[3] -- (up*unit) -- origin;
draw origin -- P[2] -- (right*unit) -- origin;
draw P[1] -- P[4];
draw P[1] -- P[5];
label.rt(\btex $s$ etex, 1/2[P[1], P[4]]);
label.top(\btex $t$ etex, 1/2[P[1], P[5]]);
label.top(\btex $\theta$ etex, 1/2[up*unit, P[3]]);
label.rt(\btex $w$ etex, 1/2[right*unit, P[2]]);
label(\btex $x$ etex, 1/5*unit*dir(Angle/2));
label.top(\btex 1 etex, .5[origin, P[1]]);
%Metapost circles are divided in 8 parts, so we divide our angle by 45
draw subpath (0,Angle/45) of fullcircle scaled (1/5*unit);
)
enddef;
draw nicecircle(\mpdim{#1}, #2) withpen currentpen;
\end{mpost}%
\usempost{circle}%
}
\begin{document}
\nicecircle{8em}{30}%Try another angle
\end{document}
答案3
我做了一些测试,这是我的结果。如果有人想改进它,欢迎提出。
\documentclass[tikz, border=30pt]{standalone}
\usetikzlibrary{angles, quotes}
\usepackage{tikz}
\usepackage{amsmath}
\usepackage{mathtools}
% TIKZ STYLES
\tikzstyle{important line}=[very thick]
\tikzstyle{information text}=[rounded corners,fill=red!10,inner sep=1ex]
\def\costhirty{0.8660256}
\begin{document}
\begin{tikzpicture}[
my angle/.style={draw, <->, angle eccentricity=1.3, angle radius=4.5mm}
]
% COLORS
\colorlet{sincolor}{red}
\colorlet{tancolor}{orange!80!black}
\colorlet{coscolor}{blue}
\colorlet{cotcolor}{yellow}
\colorlet{omegacolor}{green}
\colorlet{epsiloncolor}{purple}
% coordinate axis
\draw[<->] (-2.5,0) -- (2.5,0);
\draw[<->] (0,-2.5) -- (0,2.5);
% circle
\draw (0,0) circle (2cm);
% coordinates
\coordinate[pin= 300:{$( 1,0)$}] (A) at (2,0);
\coordinate[pin=150:{$(0, 1)$}] (B) at (0,2);
\coordinate (E) at (1,0);
\coordinate[pin=100:{$(2,2\sqrt{3})$}] (F) at (2, 3.46410161514);
\coordinate[pin=360:{$\tan x$}] (G) at (2, 1.26410161514);
\coordinate[pin=270:{$\cos x$}] (H) at (0.55, 0);
\coordinate[pin=280:{$\sin x$}] (I) at (1, 1);
\coordinate (J) at (1.15470053838, 2);
\coordinate[pin=90:{$\cot x$}] (K) at (0.8, 2);
%
\coordinate (M) at (60:2);
\coordinate (O) at ( 0:0);
% angles
\draw[thick, sincolor] (M) -- (E);
\draw[thick, coscolor] (O) -- (E);
\draw[thick] (O) -- (F);
\draw[thick, tancolor] (A) -- (F);
\draw[thick, cotcolor] (B) -- (J);
\pic[my angle, "$t$"] {angle = E--O--M};
\newline
\end{tikzpicture}
\end{document}