Plotting a triangle formed by 3d vectors in maple

In summary, in order to plot a triangle using vectors, you first need to define the vectors in terms of x, y, and z. Then you use the spacecurve command to plot the triangle.
  • #1
kyva1929
18
0
Suppose that I have three 3d vectors, pq, pr, and v, where v is the cross product of pq and pr.

I want to fill the triangle formed by these three vectors, as shown in the picture. But I'm having difficulties finding the right command doing so, I've tried the polygonplot and apparently it supports only input of vertexes in Cartesian point format.

http://math.rutgers.edu/courses/251/Lab_Backgrounds/Images/map1_image12.gif

thank you so much!
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Two non-parallel vectors and their cross-product would be three sides determining a 3-d parallelepiped, or maybe a tetrahedron, but not a triangle.

One way to do a triangle and shade it in Maple would be to actually plot a portion of the plane in whatever color. Something like this for a triangle formed by two vectors:

restart:with(VectorCalculus):BasisFormat(false):
u:=<3|-3|-1>;v:=<-2|-3|2>;
plane:=s*u+t*v;
plot3d(plane,s=0..1-t,t=0..1,color=green,axes=boxed,style=patchcontour);
 
  • #3
I misread the instruction given, however, I still have troubles with the orientation of the triangle.

I plot a triangle with P, Q, R being the vertexes, and I expected that two sides of the triangle should be parallel to the vectors PQ and PR. But it doesn't seem to be the case (I used P as the origin for the vectors).

I've checked the data multiple times and haven't yet been able to find the reason why it is so. Please take a look at that, thank you!

Here is the data:p = [10, 15, 10]
q = [15, 14, 16]
r = [15, 12, 9]

9u6lac.jpg

dr56rq.jpg


Thank you so much for the help!
 
  • #4
I hadn't seen the polygonplot command before. Try this:

restart:with(VectorCalculus):BasisFormat(false):with(plots):
>p := <10| 15| 10>:
> q := <15| 14| 16>:
> r := <15| 12| 9>:
>
> t1:=spacecurve(t*p+(1-t)*q,t=0..1,color=blue,thickness=2):
> t2:=spacecurve(t*p+(1-t)*r,t=0..1,color=blue,thickness=2):
> t3:=spacecurve(t*r+(1-t)*q,t=0..1,color=blue,thickness=2):
> triangle:=polygonplot3d([p,q,r]):
> display({t1,t2,t3,triangle},axes=normal,labels=[x,y,z]);
 
  • #5
LCKurtz said:
I hadn't seen the polygonplot command before. Try this:

restart:with(VectorCalculus):BasisFormat(false):with(plots):
>p := <10| 15| 10>:
> q := <15| 14| 16>:
> r := <15| 12| 9>:
>
> t1:=spacecurve(t*p+(1-t)*q,t=0..1,color=blue,thickness=2):
> t2:=spacecurve(t*p+(1-t)*r,t=0..1,color=blue,thickness=2):
> t3:=spacecurve(t*r+(1-t)*q,t=0..1,color=blue,thickness=2):
> triangle:=polygonplot3d([p,q,r]):
> display({t1,t2,t3,triangle},axes=normal,labels=[x,y,z]);

Thank you! It works with defining P Q and R in

>p := <10| 15| 10>:
> q := <15| 14| 16>:
> r := <15| 12| 9>:

this way, but I have no idea why it wouldn't work in the form [x,y,z] ?
 
  • #6
I dunno. Maple's distinction between lists, vectors, and matrices is confusing to me too.
 

1. How do I plot a triangle formed by 3d vectors in Maple?

To plot a triangle formed by 3d vectors in Maple, you can use the "plot3d" command followed by the three vectors as inputs. For example, the command "plot3d({[1,0,0], [0,1,0], [0,0,1]})" will plot a triangle with vertices at (1,0,0), (0,1,0), and (0,0,1).

2. Can I customize the appearance of the plotted triangle?

Yes, Maple allows you to customize the appearance of the plotted triangle by using various options in the "plot3d" command. For example, you can change the color, size, and style of the triangle using the "color", "size", and "style" options respectively.

3. How do I add labels to the plotted triangle?

To add labels to the plotted triangle, you can use the "textplot3d" command followed by the coordinates and the label for each vertex. For example, the command "textplot3d({[1,0,0],"A"}, [0,1,0],"B"}, [0,0,1],"C"})" will add labels "A", "B", and "C" to the vertices of the plotted triangle.

4. Is it possible to plot a triangle with non-unit vectors?

Yes, it is possible to plot a triangle with non-unit vectors by using the "scale" option in the "plot3d" command. This option allows you to specify the scaling factor for each vector. For example, the command "plot3d({[2,0,0], [0,3,0], [0,0,4]}, scale=[2,3,4])" will plot a triangle with side lengths of 4, 6, and 8.

5. Can I plot a triangle with vectors in different planes?

Yes, you can plot a triangle with vectors in different planes by using the "plot3d" command with the "coords" option. This option allows you to specify the coordinates of each vertex in three-dimensional space. For example, the command "plot3d({[1,0,0], [0,1,0], [0,0,1]}, coords=[2,3,0], [-1,2,3], [0,-2,1])" will plot a triangle with one vector in the xy-plane, one in the yz-plane, and one in the xz-plane.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
24
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
42K
  • Precalculus Mathematics Homework Help
Replies
3
Views
2K
  • Introductory Physics Homework Help
Replies
2
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
3K
  • Programming and Computer Science
Replies
1
Views
2K
Replies
4
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
5K
Back
Top