Star
Example from the PscFunctions package
With the help of routines of the PscFunctions package it is possible to create parametric equations of plain regions with boundaries and obtain general parametric equations of
the piecewise linear surfaces.
Here is an example of creation of the equation of the plane region in the shape of the star. At the beginning we create the LS list of coordinates of vertexes of the polygonal line representing a contour of the star. Then we pass it as the first argument to the
DPolarPolygon
routine.
> | restart; with(PscFunctions): ro:=2: ri:=1: LS:=[seq(`if`(type(i,odd),[ro*cos(2*Pi*i/10),ro*sin(2*Pi*i/10)],[ri*cos(2*Pi*i/10),ri*sin(2*Pi*i/10)]),i=0..9)]: ls1:=DPolarPolygon(LS,pole=[0,0]): plot3d([ls1(u,v),0],u=0..10,v=0..1,grid=[11,6],axes=BOXED); |
We can use the equation of the star region for creation the equation of the curvilinear surface. For that as third z coordinate of the surface one should select any nonzero function. Here as z coordinate of the surface we shall select the equation of parabola.
> | xs:=(u,v)->ls1[1](u,v): ys:=(u,v)->ls1[2](u,v): zs:=(u,v)->(1-v^2)/2: plot3d([xs(u,v),ys(u,v),zs(u,v)],u=0..10,v=0..1,grid=[11,6],axes=BOXED,scaling=CONSTRAINED); |
Here we have obtained the equation of the curvilinear surface with boundary and without bottom.
Let us generate a parametric equation of a closed curve in the star form. The
CPolyline
routine knows how to make it.
> | ro:=2: ri:=1: LS:=[seq(`if`(type(i,odd),[ro*cos(2*Pi*i/10),ro*sin(2*Pi*i/10)],[ri*cos(2*Pi*i/10),ri*sin(2*Pi*i/10)]),i=0..10)]: st:=CPolyline(LS): plot([st(t),t=0..10],thickness=2,scaling=CONSTRAINED); |
Now we shall stretch a pieceiwise-ruled surface on the frame consisting of the upper point, the polygonal line in the star form, and the lower point. The equation of the surface is generated by the SPscRuled routine. It will represent a convexo-convex surface of the star.
> | PtUp:=map(unapply,[0,0,1/2],t): PtDown:=map(unapply,[0,0,-1/2],t): ST:=SPscRuled([PtDown,[st,t->0],PtUp],[[0,10],[0,10],[0,10]],param1=0..10): plot3d([ST(u,v)],u=0..10,v=0..3,axes=BOXED,labels=["X","Y","Z"],scaling=CONSTRAINED,grid=[21,13]); `Equation of the star`; print('X'=ST[1](u,v)); print('Y'=ST[2](u,v)); print('Z'=ST[3](u,v)); |