[][src]Module gridly::vector

2-dimensional Vector type used in Location arithmetic, with supporting types and traits. A Vector is a measurement of distance between two Locations.

Structs

Columns

A columns component of a Vector

Rows

A rows component of a Vector

Vector

A measurement of distance between two Locations

Statics

DIAGONAL_ADJACENCIES

This array contains unit vectors associated with the 4 diagonal directions. It is intended to allow for easy iteration over diagonally adjacent locations. The order of the vectors is unspecified and should not be relied upon.

ORTHOGONAL_ADJACENCIES

This array contains unit vectors associated with the 4 orthogonally adjacent directions. It is intended to allow for easy iteration over orthogonally adjacent locations. The order of the vectors is unspecified and should not be relied upon.

TOUCHING_ADJACENCIES

This array contains unit vectors associated with the 8 adjacent directions. It is intended to allow for easy iteration over all locations that touch a center location (for instance, when scanning adjacencies in an implementation of Conway's Game of Life). The order of the vectors is unspecified and should not be relied upon.

Traits

Component

A Rows or Columns component of a Vector

VectorLike

VectorLike is implemented for types that can be used as a vector. They can participate in vector arithmetic, comparison, and other vector oprations.