向量的基本运算专题 二

前置知识

向量的基本运算专题 一

在专题一中,我们主要谈到了向量之间关于长度的计算,那么在这里,我们将要谈到一些另外的运算方式。
弧度与角度的换算

1 deg ⁡ = π 180 r a d , 1   r a d = 180 π deg ⁡ 1\deg=\frac{\pi}{180}rad,1\space rad=\frac{180}{\pi}\deg 1deg=180πrad,1 rad=π180deg

两向量间夹角

定义:两个非零向量 a , b a,b a,b,它们间的夹角记为 < a , b > <a,b> <a,b>

由向量的点积公式知:
∣ X ∣ ∣ Y ∣ c o s ( γ ) = x 1 y 1 + x 2 y 2 |X||Y|cos(\gamma)=x_1y_1+x_2y_2 XYcos(γ)=x1y1+x2y2
所以

< a , b > = γ = a c o s ( X ⋅ Y ∣ X ∣ ∣ Y ∣ ) = a c o s ( x 1 y 1 + x 2 y 2 ∣ X ∣ × ∣ Y ∣ ) <a,b>=\gamma=acos(\frac{X\cdot Y}{|X||Y|})=acos(\frac{x_1y_1+x_2y_2}{|X|\times|Y|}) <a,b>=γ=acos(XYXY)=acos(X×Yx1y1+x2y2)
我们从上述式子也可得出与 ( x , y ) (x,y) (x,y)垂直的一个向量为 ( y , − x ) (y,-x) (y,x)
代码如下:

double Dot(const Vector &p,const Vector &q){
	return p.x*q.x+p.y*q.y;
}
double Length(const Vector &p){
	return sqrt(Dot(p,p));
}
double Angle(const Vector &p,const Vector &q){
	return acos(Dot(p,q)/Length(p)/Length(q));
}

123
a , b , c a,b,c a,b,c ∠ A , ∠ B , ∠ C \angle A,\angle B,\angle C A,B,C 的对边, R R R Δ A B C \Delta ABC ΔABC的外接圆半径

正弦定理

a s i n A = b s i n B = c s i n C = 2 R \frac{a}{sinA}=\frac{b}{sinB}=\frac{c}{sinC}=2R sinAa=sinBb=sinCc=2R

余弦定理

a 2 = b 2 + c 2 − 2 b c cos ⁡ A a^2=b^2+c^2-2bc\cos A a2=b2+c22bccosA
b 2 = a 2 + c 2 − 2 a c cos ⁡ B b^2=a^2+c^2-2ac\cos B b2=a2+c22accosB
c 2 = a 2 + b 2 − 2 a b cos ⁡ C c^2=a^2+b^2-2ab\cos C c2=a2+b22abcosC

向量的旋转

在这里插入图片描述
∣ a ⃗ ∣ = L |\vec a|=L a =L,那么我们有
x = L ∗ c o s β , y = L ∗ s i n β x=L*cos\beta,y=L*sin\beta x=Lcosβ,y=Lsinβ
c o s ( β + θ ) = c o s β c o s θ − s i n β s i n θ cos(\beta+\theta)=cos\beta cos\theta-sin\beta sin\theta cos(β+θ)=cosβcosθsinβsinθ
s i n ( β + θ ) = s i n β c o s θ + c o s β s i n θ sin(\beta+\theta)=sin\beta cos\theta+cos\beta sin\theta sin(β+θ)=sinβcosθ+cosβsinθ
x ′ = L ∗ c o s ( β + θ ) = x c o s θ − y s i n θ x'=L*cos(\beta+\theta)=xcos\theta-ysin\theta x=Lcos(β+θ)=xcosθysinθ
y ′ = L ∗ s i n ( β + θ ) = y c o s θ + x s i n θ y'=L*sin(\beta+\theta)=ycos\theta+xsin\theta y=Lsin(β+θ)=ycosθ+xsinθ

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值