Ask Your Question
0

How to plot a 3D Triangle (prism) using parametric_plot3d

asked 2016-05-28 21:33:05 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I need to plot a 3d Triangle (prism), but i dont have any idea of how to make it. I try a lot of things but didn't work, please help me.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-05-28 22:53:48 +0200

calc314 gravatar image

Here is one approach. This does not plot the ends.

var('s t')

p0start=vector([1,0,0])
p1start=vector([-1/2,0,sqrt(3)/2])
p2start=vector([-1/2,0,-sqrt(3)/2])

p0end=vector([1,1,0])
p1end=vector([-1/2,1,sqrt(3)/2])
p2end=vector([-1/2,1,-sqrt(3)/2])

side1=(1-s)*((1-t)*p0start+t*p1start)+s*((1-t)*p0end+t*p1end)
side2=(1-s)*((1-t)*p1start+t*p2start)+s*((1-t)*p1end+t*p2end)
side3=(1-s)*((1-t)*p2start+t*p0start)+s*((1-t)*p2end+t*p0end)

parametric_plot3d(side1,(t,0,1),(s,0,1))+parametric_plot3d(side2,(t,0,1),(s,0,1))+parametric_plot3d(side3,(t,0,1),(s,0,1))
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-05-28 21:33:05 +0200

Seen: 371 times

Last updated: May 28 '16