Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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))