Positions on a grid of width by height tiles whose opposite edges join when
wrap?, as Cauldron2D.Grid.Coarse measures them. Any map with those three keys is a
space.
Space.delta(%{width: 10, height: 10, wrap?: true}, {9.5, 0.5}, {0.5, 0.5})
#=> {1.0, 0.0}
Summary
Functions
How far to lies from from on each axis, the short way across joined edges.
The straight distance from a to b, the short way across joined edges.
The place of point nearest reference: point itself, or on a wrapping grid the copy of it across the edges closest to reference.
The tile holding point, brought onto the grid when it wraps, or nil when it lies off a grid that does not.
Types
@type t() :: %{ :width => pos_integer(), :height => pos_integer(), :wrap? => boolean(), optional(atom()) => term() }
Functions
How far to lies from from on each axis, the short way across joined edges.
The straight distance from a to b, the short way across joined edges.
The place of point nearest reference: point itself, or on a wrapping grid the copy of it across the edges closest to reference.
The tile holding point, brought onto the grid when it wraps, or nil when it lies off a grid that does not.