matlab向量问题If P1 is (1,2,3) and P2 is (-4,0,5),find(a) The ve
来源:学生作业帮 编辑:作业帮 分类:数学作业 时间:2024/08/23 02:08:10
matlab向量问题
If P1 is (1,2,3) and P2 is (-4,0,5),find
(a) The vector equation of the line P1P2
(b) The shortest distance between the line P1P2 and point P3(7,-1,2)
If P1 is (1,2,3) and P2 is (-4,0,5),find
(a) The vector equation of the line P1P2
(b) The shortest distance between the line P1P2 and point P3(7,-1,2)
方程:
x=-5*t+1
y=-2*t+2
z=2*t+3
最短距离:5.0513
参考程序:
clc
p1=[1,2,3];
p2=[-4,0,5];
p3=[7 -1 2];
dp=p2-p1;
%直线的方程:
syms t
f=dp'*t+p1';
disp('方程:')
f
t=linspace(-1,2.1,4);
f1=-5*t+1;
f2=-2*t+2;
f3=2*t+3;
plot3(f1,f2,f3);hold on;
plot3(1,2,3,'r.','markersize',20);hold on;
plot3(-4,0,5,'r.','markersize',20);hold on;
plot3(7,-1,2,'b.','markersize',20);hold on;
text(1+.5,2,3,'P1');
text(-4+.5,0,5.5,'P2');
text(7+.5,-1,2,'P3');
p1p2=p1-p2;
p2p3=p2-p3;
st=acos(dot(p1p2,p2p3)/(norm(p1p2)*norm(p2p3)));
z=sin(st)*norm(p2p3); %最短距离
disp(['最短距离:' num2str(z)])
x=-5*t+1
y=-2*t+2
z=2*t+3
最短距离:5.0513
参考程序:
clc
p1=[1,2,3];
p2=[-4,0,5];
p3=[7 -1 2];
dp=p2-p1;
%直线的方程:
syms t
f=dp'*t+p1';
disp('方程:')
f
t=linspace(-1,2.1,4);
f1=-5*t+1;
f2=-2*t+2;
f3=2*t+3;
plot3(f1,f2,f3);hold on;
plot3(1,2,3,'r.','markersize',20);hold on;
plot3(-4,0,5,'r.','markersize',20);hold on;
plot3(7,-1,2,'b.','markersize',20);hold on;
text(1+.5,2,3,'P1');
text(-4+.5,0,5.5,'P2');
text(7+.5,-1,2,'P3');
p1p2=p1-p2;
p2p3=p2-p3;
st=acos(dot(p1p2,p2p3)/(norm(p1p2)*norm(p2p3)));
z=sin(st)*norm(p2p3); %最短距离
disp(['最短距离:' num2str(z)])
已知P1,p2,P ,三点共线 p1(-2,3),p2(0,1),若向量p1p2=2向量pp2,求p的坐标(x,y)
指针的逻辑运算例题 inta[5]={1,3,5,7,9},*p1=a,*p2=0;那么 p1,p2,为真,p2,p1&
已知p1(2,3),p2(-4,5),A(-1,2),直线l经过A点,且p1,p2到直线的距离相等,求直线的方程
C语言问题:int a[10],*P1,*P2; P1 =& a[0]; P2 =& a[5];
根据下列条件,求p1p2两点间的距离 p1(0,-2)p2(3,0) P1(-3,1),P2(2,4) P1(4,-2)
英语翻译1.Find the cost and selling price if a pen is marked up
已知点P1(-1,a),P2(3,6),且P1 P2的斜率k=2,则| P1 P2|=
#includevoid main(){int *p1,*p2,a[5]={1,3,5,7,9};for(p1=a;p1
概率学的问题..P(A-B)=p1 P(B-A)=p2 求P(A∩B) A B相互独立 0≤p1,p2≤p1+p2≤1
If 2 is a company and 3 is a crowd,what are 4 and
P1(2,1),P2(0,-3)的截距式
What is the sinA if A is in standard position and (2,-7) is