# hypercube -- Returns the d-dimensional hypercube

## Synopsis

• Usage:
P = hypercube d
P = hypercube(d, s)
P = hypercube(d, a, b)
• Inputs:
• d, an integer, the dimension, a strictly positive integer
• s, , a positive rational scaling factor
• a, ,
• b, ,
• Outputs:
• P, ,

## Description

Produces the d-dimensional hypercube $[-1,1]^d$. If provided with a scaling factor $s$, the hypercube $[-s,s]^d$ is returned. Alternatively one can specify the edge directly as $[a,b]$, then the hypercube $[a,b]^d$ is returned

 i1 : P = hypercube 3 o1 = P o1 : Polyhedron i2 : vertices P o2 = | -1 1 -1 1 -1 1 -1 1 | | -1 -1 1 1 -1 -1 1 1 | | -1 -1 -1 -1 1 1 1 1 | 3 8 o2 : Matrix QQ <--- QQ
 i3 : P = hypercube(3,2) o3 = P o3 : Polyhedron i4 : vertices P o4 = | -2 2 -2 2 -2 2 -2 2 | | -2 -2 2 2 -2 -2 2 2 | | -2 -2 -2 -2 2 2 2 2 | 3 8 o4 : Matrix QQ <--- QQ
 i5 : P = hypercube(3,0,1) o5 = P o5 : Polyhedron i6 : vertices P o6 = | 0 1 0 1 0 1 0 1 | | 0 0 1 1 0 0 1 1 | | 0 0 0 0 1 1 1 1 | 3 8 o6 : Matrix QQ <--- QQ

## Ways to use hypercube :

• "hypercube(ZZ)"
• "hypercube(ZZ,QQ)"
• "hypercube(ZZ,QQ,QQ)"
• "hypercube(ZZ,QQ,ZZ)"
• "hypercube(ZZ,ZZ)"
• "hypercube(ZZ,ZZ,QQ)"
• "hypercube(ZZ,ZZ,ZZ)"

## For the programmer

The object hypercube is .