Borrar filtros
Borrar filtros

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 visualizaciones (últimos 30 días)
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)

Respuestas (2)

Fabio Freschi
Fabio Freschi el 26 de Sept. de 2019
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 comentario
Peter Pyrka
Peter Pyrka el 27 de Sept. de 2019
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

Iniciar sesión para comentar.


Fabio Freschi
Fabio Freschi el 27 de Sept. de 2019
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

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by