Planet v0.1.1 GEOF.Planet.Field
Functions for handling an individual Field on a Planet.
Link to this section Summary
Types
Provides the indexes of Fields that are adjacent to this Field, organized by specific relative positions relevant to the way the Sphere is organized
A Field’s index uniquely identifies it on a Sphere and it’s used to identify its position and which Fields are adjacent
Functions
Provides a map of indexes for a field’s adjacent fields
Determines the 1-dimensional integer index of a Field given its index and the Sphere’s number of divisions
Stringifies a Field index
Provides a map of indexes for a field’s adjacent fields
Link to this section Types
Provides the indexes of Fields that are adjacent to this Field, organized by specific relative positions relevant to the way the Sphere is organized.
For pentagonal fields, all located at a vertex of the icosahedron, no ne
adjacent Field is defined.
index() :: :north | :south | {:sxy, non_neg_integer(), non_neg_integer(), non_neg_integer()}
A Field’s index uniquely identifies it on a Sphere and it’s used to identify its position and which Fields are adjacent.
If the Field is not one of the poles, it’s defined by its SXY coordinates, where S is
the section 0..4
, X is 0..divisions * 2
, Y is 0..divisions
.
Link to this section Functions
adjacents(index(), GEOF.Planet.Sphere.divisions()) :: adjacents_map()
Provides a map of indexes for a field’s adjacent fields.
flatten_index(index(), GEOF.Planet.Sphere.divisions()) :: non_neg_integer()
Determines the 1-dimensional integer index of a Field given its index and the Sphere’s number of divisions.
Stringifies a Field index.
is_pentagon(index(), GEOF.Planet.Sphere.divisions()) :: boolean()
Provides a map of indexes for a field’s adjacent fields.