各位随便看看吧
1 三角函数基础与常用公式
1.1 基本定义与原理
三角函数是数学中用来描述角度与三角形边长关系的函数,最主要的三种函数是:
正弦(sin \sin sin ):角的对边与斜边的比值
余弦(cos \cos cos ):角的邻边与斜边的比值
正切(tan \tan tan ):角的对边与邻边的比值
三角函数的定义基于直角三角形,也可以通过单位圆进行推广:
在半径为 1 1 1 的单位圆上,角度 θ \theta θ 对应点的坐标是 ( cos θ , sin θ ) (\cos\theta,\sin\theta) ( cos θ , sin θ ) 。
1.2 三角函数的基本公式
1.2.1 三角函数的诱导公式
sin ( − θ ) = − sin θ \sin(-\theta) = -\sin\theta sin ( − θ ) = − sin θ
cos ( − θ ) = cos θ \cos(-\theta) = \cos\theta cos ( − θ ) = cos θ
tan ( − θ ) = − tan θ \tan(-\theta) = -\tan\theta tan ( − θ ) = − tan θ
1.2.2 和差角公式
sin ( a ± b ) = sin a cos b ± cos a sin b \sin(a \pm b) = \sin a \cos b \pm \cos a \sin b sin ( a ± b ) = sin a cos b ± cos a sin b
cos ( a ± b ) = cos a cos b ∓ sin a sin b \cos(a \pm b) = \cos a \cos b \mp \sin a \sin b cos ( a ± b ) = cos a cos b ∓ sin a sin b
tan ( a ± b ) = tan a ± tan b 1 ∓ tan a tan b \tan(a \pm b) = \frac{\tan a \pm \tan b}{1 \mp \tan a \tan b} tan ( a ± b ) = 1 ∓ t a n a t a n b t a n a ± t a n b
1.2.3 倍角公式
sin 2 a = 2 sin a cos a \sin 2a = 2 \sin a \cos a sin 2 a = 2 sin a cos a
cos 2 a = cos 2 a − sin 2 a = 2 cos 2 a − 1 = 1 − 2 sin 2 a \cos 2a = \cos^2 a - \sin^2 a = 2 \cos^2 a - 1 = 1 - 2 \sin^2 a cos 2 a = cos 2 a − sin 2 a = 2 cos 2 a − 1 = 1 − 2 sin 2 a
tan 2 a = 2 tan a 1 − tan 2 a \tan 2a = \frac{2 \tan a}{1 - \tan^2 a} tan 2 a = 1 − t a n 2 a 2 t a n a
1.3 三角函数的常用性质与例题
1.3.1 单位圆示意
单位圆上,角度从 0 ∘ 0^\circ 0 ∘ 到 36 0 ∘ 360^\circ 36 0 ∘ ,sin \sin sin 值对应点的 y y y 坐标,cos \cos cos 值对应 x x x 坐标。
角度越大,sin \sin sin 与 cos \cos cos 变化呈周期性。
2 三角函数在题目和算法中的应用
2.1 计算角度的 sin \sin sin 值(用余弦定理)
已知三角形三边长 a , b , c a,b,c a , b , c ,求角 A A A 的 sin \sin sin 值。
利用余弦定理:
cos A = b 2 + c 2 − a 2 2 b c \cos A = \frac{b^2 + c^2 - a^2}{2bc} cos A = 2 b c b 2 + c 2 − a 2
sin A = 1 − cos 2 A \sin A = \sqrt{1 - \cos^2 A} sin A = 1 − cos 2 A
2.2 角度计算:两向量夹角的余弦值
向量 u = ( x 1 , y 1 ) u = (x_1,y_1) u = ( x 1 , y 1 ) ,v = ( x 2 , y 2 ) v = (x_2,y_2) v = ( x 2 , y 2 ) ,夹角 θ \theta θ 满足:
cos θ = x 1 x 2 + y 1 y 2 ∣ u ∣ ∣ v ∣ \cos \theta = \frac{x_1 x_2 + y_1 y_2}{|u||v|} cos θ = ∣ u ∣∣ v ∣ x 1 x 2 + y 1 y 2
其中 ∣ u ∣ = x 1 2 + y 1 2 |u| = \sqrt{x_1^2 + y_1^2} ∣ u ∣ = x 1 2 + y 1 2
2.3 例题3:求两向量夹角的余弦值
向量 u = ( 1 , 0 ) u = (1,0) u = ( 1 , 0 ) ,v = ( 0 , 1 ) v = (0,1) v = ( 0 , 1 )
cos θ = 1 × 0 + 0 × 1 1 × 1 = 0 \cos \theta = \frac{1 \times 0 + 0 \times 1}{1 \times 1} = 0 cos θ = 1 × 1 1 × 0 + 0 × 1 = 0
夹角为 9 0 ∘ 90^\circ 9 0 ∘
3 数学例题
3.1 例题1
已知 sin a = 3 5 \sin a = \frac{3}{5} sin a = 5 3 ,a a a 为第一象限角,求 cos a \cos a cos a 。
答案点击我 → \rightarrow →
3.2 例题2
已知角 x x x 满足 sin x = 5 13 \sin x = \frac{5}{13} sin x = 13 5 ,且 x x x 在第二象限,求 cos x \cos x cos x 和 tan x \tan x tan x 。
答案点击我 → \rightarrow →
3.3 例题3
点 P ( 2 , 3 ) P(2,3) P ( 2 , 3 ) 绕原点逆时针旋转 6 0 ∘ 60^\circ 6 0 ∘ ,求旋转后的点 P ′ P' P ′ 坐标。
答案点击我 → \rightarrow →
4 编程例题
4.1.1 数学原理
点绕原点旋转 θ \theta θ 度后的坐标变化如下:
x ′ = x ⋅ cos θ − y ⋅ sin θ y ′ = x ⋅ sin θ + y ⋅ cos θ
x' = x \cdot \cos\theta - y \cdot \sin\theta
y' = x \cdot \sin\theta + y \cdot \cos\theta
x ′ = x ⋅ cos θ − y ⋅ sin θ y ′ = x ⋅ sin θ + y ⋅ cos θ
其中 θ \theta θ 必须用弧度制参与三角函数运算:
θ rad = θ × π 180
\theta_{\text{rad}} = \theta \times \frac{\pi}{180}
θ rad = θ × 180 π
4.1.2 题目正解
from math import sin,cos,radians
x,y,t = input ().split()
x,y = float (x),float (y)
t = int (t)
r = radians(t)
x2 = x * cos(r) - y * sin(r)
y2 = x * sin(r) + y * cos(r)
print (f"{x2:.4 f} {y2:.4 f} " )
有帮助,赞一个