Hexagon#

class sionna.sys.Hexagon(radius: float, coord: List[int] | Tuple[int, int] | torch.Tensor, coord_type: str = 'offset', precision: Literal['single', 'double'] | None = None, device: str | None = None)[source]#

Bases: sionna.phy.object.Object

Class defining a hexagon placed in a hexagonal grid.

Parameters:
  • radius (float) – Hexagon radius, defined as the distance between the hexagon center and any of its corners

  • coord (List[int] | Tuple[int, int] | torch.Tensor) – Coordinates of the hexagon center within the grid with shape [2]. If coord_type is ‘euclid’, the unit of measurement is meters [m].

  • coord_type (str) – Coordinate type of coord. One of ‘offset’ (default), ‘axial’, or ‘euclid’.

  • precision (Literal['single', 'double'] | None) – Precision used for internal calculations and outputs. If set to None, precision is used.

  • device (str | None) – Device for computation. If None, device is used.

Attributes

property coord_offset: torch.Tensor#

[2], torch.int32 : Offset coordinates of the hexagon within a grid. The first (second) coordinate defines the horizontal (vertical) offset with respect to the grid center.

../../_images/offset_coord.png
property coord_axial: torch.Tensor#

[2], torch.int32 : Axial coordinates of the hexagon within a grid.

../../_images/axial_coord.png

The basis of axial coordinates are 2D vectors \(\mathbf{b}^{(1)}=\left(\frac{3}{2}r,\frac{\sqrt{3}}{2}r \right)\), \(\mathbf{b}^{(2)}=\left(0, \sqrt{3}r \right)\). Thus, the relationship between axial coordinates \(\mathbf{a}=(a_1,a_2)\) and their corresponding Euclidean ones \(\mathbf{x}=(x_1,x_2)\) is the following:

\[\mathbf{x} = a_1 \mathbf{b}^{(1)} + a_2 \mathbf{b}^{(2)}\]
../../_images/axial_coord_basis.png
property coord_euclid: torch.Tensor#

[2], torch.float : Euclidean coordinates of the hexagon within a grid.

../../_images/euclid_coord.png
property radius: torch.Tensor#

torch.float : Hexagon radius, defined as the distance between its center and any of its corners.

Methods

corners() torch.Tensor[source]#

Computes the Euclidean coordinates of the 6 corners of the hexagon.

Outputs:

corners – Euclidean coordinates of the 6 corners with shape [6, 2], torch.float

neighbor(axial_direction_idx: int) sionna.sys.topology.Hexagon[source]#

Returns the neighboring hexagon over the specified axial direction.

Parameters:

axial_direction_idx (int) – Index determining the neighbor relative axial direction with respect to the current hexagon. Must be one of {0,…,5}.

Outputs:

neighborHexagon – Neighboring hexagon, in the axial relative direction

coord_dict() Dict[str, torch.Tensor][source]#

Returns the hexagon coordinates in the form of a dictionary.

Outputs:

coord_dictdict – Dictionary containing the three hexagon coordinates, with keys ‘euclid’, ‘offset’, ‘axial’