# Cube

Cubes in 3d space

## Synopsis

Example t/cube.t

`````` #_ Cube _______________________________________________________________
# Test cube
#______________________________________________________________________

use Math::Zap::Cube unit=>u;
use Test::Simple tests=>5;

ok(u    eq 'cube(vector(0, 0, 0), vector(1, 0, 0), vector(0, 1, 0), vector(0, 0, 1))');
ok(u->a eq 'vector(0, 0, 0)');
ok(u->x eq 'vector(1, 0, 0)');
ok(u->y eq 'vector(0, 1, 0)');
ok(u->z eq 'vector(0, 0, 1)');
``````

## Description

Define and manipulate a cube in 3 dimensions

## Constructors

### new

Create a rectangle from 3 vectors:

a position of corner
x first side
y second side
z third side

### cube

Synonym for "new"

Unit cube

## Methods

### Check

Check that an anonymous reference is a reference to a cube and confess if it is not.

### is

Same as "check" but return the result to the caller.

### a, x, y, z

Components of cube

### Clone

Create a cube from another cube

### Accuracy

Get/Set accuracy for comparisons

Add a vector to a cube

### Subtract

Subtract a vector from a cube

### Multiply

Cube times a scalar

### Divide

Cube divided by a non zero scalar

Print cube

Triangulate cube

### Subtract

Subtract operator.

### Multiply

Multiply operator.

Divide operator.

Equals operator.

Print a cube

## Exports

Export "cube", "unit"

## Credits

### Author

philiprbrenan@yahoo.com

philiprbrenan@yahoo.com, 2004