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.ObjectClass 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_typeis ‘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,
precisionis used.device (str | None) – Device for computation. If None,
deviceis 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.
- property coord_axial: torch.Tensor#
[2], torch.int32 : Axial coordinates of the hexagon within a grid.
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)}\]
- property coord_euclid: torch.Tensor#
[2], torch.float : Euclidean coordinates of the hexagon within a grid.
- 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.
- coord_dict() Dict[str, torch.Tensor][source]#
Returns the hexagon coordinates in the form of a dictionary.
- Outputs:
coord_dict – dict – Dictionary containing the three hexagon coordinates, with keys ‘euclid’, ‘offset’, ‘axial’