Go to the previous, next section.

A number of math operations are available in the `vector_space`

class. These include addition, subtraction and intersection. The
meanings of these operations are described in detail below. For all
these operations, either a new vector space can be created (i.e. ```
X
= V + W
```

) or the result can be stored into one of the operands (i.e.
`X += V`

).

Given two spaces `V`

and `W`

, then `X = V + W`

is the
vector space made up of all possible combinations `x = v + w`

,
where `v`

is an element of `V`

and `w`

is an element of
`W`

. Both `V`

and `W`

must have the same space
dimension. For example:

{(1, 0)} + {(1, 1)} = {(1, 0), (0, 1)}

Given two spaces `V`

and `W`

, then `X = V - W`

is the
vector space `V`

with all the common directions removed. Both
`V`

and `W`

must have the same space dimension.

For example:

{(1, 0), (0, 1)} - {(1, 1)} = {(1, -1)}

The multiplication operator is used for vector space intersection.
Given two spaces `V`

and `W`

, then `X = V * W`

is the
space whose vectors are in both `V`

and `W`

. Both `V`

and `W`

must have the same space dimension. For example:

{(1, 0)} * {(0, 1)} = {}

Go to the previous, next section.