Drawing a cube with Maple
Note: The commands that I needed to type are those that follow the symbol ">". Pay particular attention to square brackets, parentheses, colons, and semicolons.
The following commands load in some useful packages.
> | with(plots): with(plottools): |
Warning, the name arrow has been redefined
Warning, the name arrow has been redefined
Draw a good diagram of the cube on paper first. Determine the coordinates of the eight vertices.
> | p1:=[0,0,0]; p2:=[1,0,0]; p3:=[0,1,0]; p4:=[1,1,0]; p5:=[0,0,1]; p6:=[1,0,1]; p7:=[0,1,1]; p8:=[1,1,1]; |
Define a cube by giving the vertices for each square face, in the order that they appear around the square.
> | c:=polygonplot3d([ [p1,p2,p4,p3], [p5,p6,p8,p7], [p1,p2,p6,p5], [p3,p4,p8,p7], [p1,p3,p7,p5], [p2,p4,p8,p6]],color=yellow): |
Display the result. You can click and drag it to turn it around and view it from different directions.
> | display(c,scaling=constrained); |
> |