# How to parameterize a pyramid with a square base?

I wanted to parameterize and draw a pyramid with a square base. The base was parameterized as a function of t , getting:

Show[ParametricPlot3D[{t, 0, 0}, {t, 0, 4}],
ParametricPlot3D[{4, t - 4, 0}, {t, 4, 8}],
ParametricPlot3D[{12 - t, 4, 0}, {t, 8, 12}],
ParametricPlot3D[{0, 16 - t, 0}, {t, 12, 16}], PlotRange -> Full]


The pyramid would be lifted from a point (2,2,8) , but when I draw the line between that vertex and one of the base lines, nothing works, and it separates all the graphs. Is there a better way for me to do this?

• Do you really need the parametrization, or do you just want to draw a pyramid? In latter, you can use Pyramid. Also, instead of ParametricPlot3D, you can simply use Line. Mar 26 at 20:51
• I actually need the parametrization. I already used the Line command to do that but it's not really what I wanted.
– Sara
Mar 26 at 20:53

Show[
{ParametricPlot3D[{0, 0, 0} t + (1 - t) {4, 0, 0}, {t, 0, 1}],
ParametricPlot3D[{4, 0, 0} t + (1 - t) {4, 4, 0}, {t, 0, 1}],
ParametricPlot3D[{4, 4, 0} t + (1 - t) {0, 4, 0}, {t, 0, 1}],
ParametricPlot3D[{0, 4, 0} t + (1 - t) {0, 0, 0}, {t, 0, 1}],
ParametricPlot3D[{0, 0, 0} t + (1 - t) {2, 2, 6}, {t, 0, 1}],
ParametricPlot3D[{4, 0, 0} t + (1 - t) {2, 2, 6}, {t, 0, 1}],
ParametricPlot3D[{0, 4, 0} t + (1 - t) {2, 2, 6}, {t, 0, 1}],
ParametricPlot3D[{4, 4, 0} t + (1 - t) {2, 2, 6}, {t, 0, 1}]
},  PlotRange -> Full]


You forgot the list bracket of objects. The line parametrization is done conventionally by the convex combination of two points with factors t amd 1-t for t in the unit interval

• Oh, I see. Thank you for the help!
– Sara
Mar 26 at 22:00
• Show works with or without the curly brackets, as illustrated in the documentation. Mar 27 at 1:47