Multistage Pyramid
Example from the PscFunctions package
With the help of routines of the package users can construct general parametric equation of
a polyhedral or a piecewise linear surface.
In the first example we shall create a circular multistage pyramid. At first we create two continuous piecewise linear functions using
FPolyline
routine of the package.
> | restart; with(PscFunctions): f1:=FPolyline([[0,0],[1,1/3],[2,1/3],[3,2/3],[4,2/3],[5,1],[6,1],[7,0]]): f2:=FPolyline([[1,0],[2,1/3],[3,1/3],[4,2/3],[5,2/3],[6,1]]): plot([f1(x),f2(x)],x=-1..8,thickness=[2,3],color=[RED,BLACK],numpoints=1000); print('f1'=f1(x)); print('f2'=f2(x)); |
With the help of these functions we shall create three functions, which will represent parametric equation of the circular multistage pyramid with both bases.
> | R:=8: H:=15: x:=(u,v)->R*cos(u)*f1(v): y:=(u,v)->R*sin(u)*f1(v): z:=(u,v)->f2(v)*H: plot3d([x(u,v),y(u,v),z(u,v)],u=0..2*Pi,v=0..7,scaling=CONSTRAINED,grid=[31,29],orientation=[30,-60]); |
Let us look at the equation of the surface.
> | print('x'=x(u,v)); print('y'=y(u,v)); print('z'=z(u,v)); |
In these expressions it is possible to replace the equation of the circle by the equation of any closed curve. Let's take, for example, the regular hexagon. The CRegularGon routine generates parametric equation of polyline of a regular polygon. Here is its equation.
> | poly6:=CRegularGon(6,8): plot([poly6(t),t=0..6],-10..10,-10..10,thickness=2,scaling=CONSTRAINED,numpoints=1000); print('x'=poly6[1](t)); print('y'=poly6[2](t)); |
Instead of factors R*cos(u) and R*sin(u) in the equation of the circular multistage pyramid we shall take the functions poly6[i]. As a result we get the equation of a hexagonal multistage pyramid.
> | x:=(u,v)->poly6[1](u)*f1(v): y:=(u,v)->poly6[2](u)*f1(v): z:=(u,v)->f2(v)*H: plot3d([x(u,v),y(u,v),z(u,v)],u=0..6,v=0..7,scaling=CONSTRAINED,grid=[25,22],orientation=[-140,-125]); |
Here is its equation.
> | 'x'=x(u,v); 'y'=y(u,v); 'z'=z(u,v); |