Defining special 3D coordinates for honeycomb lattices
constructor override
Safe cubic constructor for the hex type featuring an assertion on input coordinates before the initialization of the object
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | q | |||
| integer, | intent(in) | :: | r | |||
| integer, | intent(in) | :: | s |
Axial cubic constructor for the hex type [s would be computed internally]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | q | |||
| integer, | intent(in) | :: | r |
equality overload
inequality overload
addition overload
subtraction overload
product overload
Right scale overload for hex type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hex), | intent(in) | :: | A | |||
| integer, | intent(in) | :: | k |
Left scale overload for hex type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | k | |||
| type(hex), | intent(in) | :: | B |
Dot overload for hex type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hex), | intent(in) | :: | A | |||
| type(hex), | intent(in) | :: | B |
cubic coordinates for hexagonal tiles
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | q |
constrained by q+r+s==0 |
|||
| integer, | public | :: | r |
constrained by q+r+s==0 |
|||
| integer, | public | :: | s |
constrained by q+r+s==0 |
constructor override
| private pure function new_hex_cubic (q, r, s) | Safe cubic constructor for the hex type featuring an assertion on input coordinates before the initialization of the object |
| private pure function new_hex_axial (q, r) | Axial cubic constructor for the hex type [s would be computed internally] |
Taxicab norm from hex coordinates
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hex), | intent(in) | :: | H |
Safe cubic constructor for the hex type featuring an assertion on input coordinates before the initialization of the object
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | q | |||
| integer, | intent(in) | :: | r | |||
| integer, | intent(in) | :: | s |
Axial cubic constructor for the hex type [s would be computed internally]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | q | |||
| integer, | intent(in) | :: | r |