Previous Up Next

27.11.14  Checking whether an object in space is a parallelogram

See Section 26.15.10 for checking for parallelograms in 2D geometry.

The is_parallelogram command determines whether or not an object is a parallelogram.

Examples

is_parallelogram([0,0,0],[2,0,0],[3,1,0],[1,1,0])
     
1           
is_parallelogram([-1,0,0],[0,1,0],[2,0,0],[0,-1,0])
     
0           
P:=parallelogram([0,0,0],[2,0,0],[1,1,0]); is_parallelogram(P)
     
1           

Note that

P:=parallelogram([0,0,0],[2,0,0],[1,1,0],D)

defines P to be a list consisting of the parallelogram and the point D; to test if the object is a parallelogram, the first component of P needs to be tested.

is_parallelogram(P[0])
     
1           
is_parallelogram([-1,0,0],[0,1,0],[2,0,0],[0,-1,0])
     
0           

Previous Up Next