Forgot password?
 Create new account
View 362|Reply 4

请教余弦曲线的交点要怎么画

[Copy link]

418

Threads

1628

Posts

110K

Credits

Credits
11891

Show all posts

abababa Posted at 2021-8-1 17:18:16 |Read mode
如题,我想画$\cos(x)$和$\cos(\frac{x}{2})$在区间$[-4\pi,4\pi]$上的所有交点,请教这个要怎么画?

701

Threads

110K

Posts

910K

Credits

Credits
94167
QQ

Show all posts

kuing Posted at 2021-8-1 17:29:21
在 latex 里估计完成不了,用其他工具搞出交点坐标吧

418

Threads

1628

Posts

110K

Credits

Credits
11891

Show all posts

 Author| abababa Posted at 2021-8-1 21:39:09
回复 2# kuing

原来如此,这个交点还是挺好求的,就是$4\pi$和$4\pi\pm\frac{4\pi}{3}$。
  1. \begin{tikzpicture}[scale=0.3]
  2. \draw[color=red, smooth, samples=100, domain=-16:16.0] plot(\x,{cos(((\x))*180/pi)});
  3. \draw[color=blue, smooth, samples=100, domain=-16:16.0] plot(\x,{cos(((\x)/2)*180/pi)});
  4. \node[circle, line width=1pt, fill=OliveGreen] (A_0) at (0,1){};
  5. \node[circle, line width=1pt, fill=OliveGreen] (A_1) at ({pi*4/3},-0.5){};
  6. \node[circle, line width=1pt, fill=OliveGreen] (A_2) at ({pi*8/3},-0.5){};
  7. \node[circle, line width=1pt, fill=OliveGreen] (A_3) at ({pi*4},1){};
  8. \end{tikzpicture}
Copy the Code
先画了几个点,不过那个交点怎么这么大,要怎么才能调小呢?我原来用fill来画的,但是后面又需要把一些点连起来,觉得还是用node好。

701

Threads

110K

Posts

910K

Credits

Credits
94167
QQ

Show all posts

kuing Posted at 2021-8-1 21:49:56
回复 3# abababa

将 line width=1pt 改为 inner sep=2pt 即可。

PS、弧度制用 \x r 就行了,即
... plot(\x,{cos(\x r)});
... plot(\x,{cos(\x/2 r)});

418

Threads

1628

Posts

110K

Credits

Credits
11891

Show all posts

 Author| abababa Posted at 2021-8-2 09:30:02
回复 4# kuing

原来如此,改好了。那个弧度、角度的还是我从geogebra里复制过来的,没想到还能直接用弧度。

手机版Mobile version|Leisure Math Forum

2025-4-20 21:59 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list