得鹿梦鱼 得鹿梦鱼

三角学

三角形在计算机图形中扮演一个至关重要的角色,它帮助我们理解和操纵角度、距离和位置。通过三角学,我们可以在处理视口显示等问题时利用极坐标的概念

概念

角度angles

在两条半线或方向之间形成一个角。这些半线有一个共同的起源。这两条线之间有两个可能的角。我们需要一个惯例来选择使用哪一个
一个常见的惯例是用较小的弧长作为角。角的符号由半线的顺序决定。按照这个惯例,所有角度都在这个范围内[π,π][-\pi, \pi]

角的单位是弧度或度数。整个圆是2π弧度或360度

转换关系

弧度 = 180π×角度\frac{180}{\pi} \times 角度
角度 = π180×弧度\frac{\pi}{180} \times 弧度

对于直角三角形

a2+b2=c2a^2 + b^2 = c^2
sinθ=ac\sin \theta = \frac{a}{c}
cosθ=bc\cos \theta = \frac{b}{c}
tanθ=ab\tan \theta = \frac{a}{b}
cotθ=ba\cot \theta = \frac{b}{a}
cscθ=ca\csc \theta = \frac{c}{a}
secθ=cb\sec \theta = \frac{c}{b}

常用的三角恒等式

sinθ=sinθ\sin -\theta = -\sin \theta
cosθ=cosθ\cos -\theta = \cos \theta
sinπ2θ=cosθ\sin \frac{\pi}{2} - \theta = \cos \theta
cosπ2θ=sinθ\cos \frac{\pi}{2} - \theta = \sin \theta
sin2θ+cos2θ=1\sin^2 \theta + \cos^2 \theta = 1

sinθ+α=sinθcosα+cosθsinα\sin \theta + \alpha = sin \theta cos \alpha + cos \theta sin \alpha
cosθ+α=cosθcosαsinθsinα\cos \theta + \alpha = cos \theta cos \alpha - sin \theta sin \alpha
sin2θ=2sinθcosθ\sin 2\theta = 2 sin \theta cos \theta
cos2θ=cos2θsin2θ\cos 2\theta = \cos^2 \theta - \sin^2 \theta

面积公式

S=a+b+ca+b+cab+ca+bc4S = \frac{\sqrt{a + b + c-a + b + ca - b + ca + b - c}}{4}