필터 지우기
필터 지우기

I want to Plot a triangle using points p, q ,and r. Also, I need to show vectors PQ and PR starting from p and their cross product vector V

조회 수: 2 (최근 30일)
They want me to use Plot3 in order to do this, but I keep getting stuck and confused and can't find a similar problem online.
the points I was given are:
p = [15,20,14];
q = [19,21,9];
r = [16,19,11];
PQ = [4,1,-5]
PR = [1,-1,3]
angle between PQ and PR = 33.1297
Cross product of PQ x PR = (-2,-17,-5)

답변 (2개)

Fabio Freschi
Fabio Freschi 2019년 9월 26일
p = [15,20,14];
q = [19,21,9];
r = [16,19,11];
% open figure and setup view
figure, hold on
view([1 1 1]);
% plot vertices
plot3([p(1); q(1); r(1)],[p(2); q(2); r(2)],[p(3); q(3); r(3)],'o');
% edge PQ
PQ = q-p;
quiver3(p(1),p(2),p(3),PQ(1),PQ(2),PQ(3),0);
% edge PR
PR = r-p;
quiver3(p(1),p(2),p(3),PR(1),PR(2),PR(3),0);
% cross product
PQxPR = cross(PQ,PR);
quiver3(p(1),p(2),p(3),PQxPR(1),PQxPR(2),PQxPR(3),0);
  댓글 수: 1
Peter Pyrka
Peter Pyrka 2019년 9월 27일
Thank you ! I am curious about two things still. Is the triangle supposed to be connected by point from r to q also? Because on my screen it only shows the vectors PR and PQ from point P and the cross product. Also, how would I find the equation of the plane containing point p,q , and r?triangle t.PNG

댓글을 달려면 로그인하십시오.


Fabio Freschi
Fabio Freschi 2019년 9월 27일
Replace the first plot with
% plot vertices
plot3([p(1); q(1); r(1); p(1)],[p(2); q(2); r(2); p(2)],[p(3); q(3); r(3); p(3)],'-o');
Concerning the plane equation, you can google "plane passing for three points".+
If my answer solves your problem, please accept it

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by