Description Usage Arguments Details Value Author(s) Examples
View source: R/hexagon_default_params.R
Function calculates parameters l
and r
for hexagon.
1 | hexagon_default_params(r = NULL, l = NULL, x = NULL, y = NULL)
|
r |
radius of circle inscribed in hexagon. Default value is |
l |
distance from the center to the upper/lower vertices of hexagon. |
x, y |
numeric vectors with hexagon center coordinates in hexagon grid. |
Function assumes regular pointy topped hexagon. (More on geometry of hexagons
can be found here).
Relation between parameters l
and r
in this kind of hexagon:
l = r / cos(pi/6)
r = l * cos(pi/6)
These proportions can be distorted to mach grid of x and y values so that hexahons vere plotted without gaps.
List with calculated values of parameters r
and l
.
Vilmantas Gegzna
1 2 3 4 5 6 7 8 9 10 11 12 | hexagon_default_params()
hexagon_default_params(r = 1)
hexagon_default_params(l = 1)
data <- class::somgrid(8,6,"hexagonal")$pts
hexagon_default_params(x = data[,"x"], y = data[,"y"])
hexagon_default_params(x = data[,"x"], y = data[,"y"]*2)
hexagon_default_params(x = data[,"x"]*2, y = data[,"y"])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.