Utility Functions

Complex-valued tensors

sionna.rt.utils.cpx_abs(x)[source]

Element-wise absolute value of a complex-valued tensor

The tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

Parameters:

x (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – A tensor

Return type:

drjit.cuda.ad.TensorXf

sionna.rt.utils.cpx_abs_square(x)[source]

Element-wise absolute squared value of a complex-valued tensor

The tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

Parameters:

x (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – A tensor

Return type:

drjit.cuda.ad.TensorXf

sionna.rt.utils.cpx_add(a,b)[source]

Element-wise addition of two complex-valued tensors

Each tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

Parameters:
  • a (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – First tensor

  • b (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – Second tensor

Return type:

typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]

sionna.rt.utils.cpx_convert(x,out_type)[source]

Converts a complex-valued tensor to any of the supported frameworks

The tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

Note that the chosen framework must be installed for this functionto work.

Parameters:
  • x (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – A tensor

  • out_type (typing.Literal['numpy','jax','tf','torch']) – Name of the target framework. Currently supportedareNumpy (“numpy”),Jax (“jax”),TensorFlow (“tf”),andPyTorch (“torch”).

Return type:

np.array |jax.array |tf.Tensor |torch.tensor

sionna.rt.utils.cpx_div(a,b)[source]

Element-wise division of a complex-valued tensor by another

Each tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

Parameters:
  • a (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – First tensor

  • b (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – Second tensor by which the first is divided

Return type:

typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]

sionna.rt.utils.cpx_exp(x)[source]

Element-wise exponential of a complex-valued tensor

The tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

Parameters:

x (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – A tensor

Return type:

typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]

sionna.rt.utils.cpx_mul(a,b)[source]

Element-wise multiplication of two complex-valued tensors

Each tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

Parameters:
  • a (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – First tensor

  • b (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – Second tensor

Return type:

typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]

sionna.rt.utils.cpx_sqrt(x)[source]

Element-wise square root of a complex-valued tensor

The tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

The following formula is implemented to compute the square roots of complexnumbers:https://en.wikipedia.org/wiki/Square_root#Algebraic_formula

Parameters:

x (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – A tensor

Return type:

drjit.cuda.ad.TensorXf

sionna.rt.utils.cpx_sub(a,b)[source]

Element-wise substraction of a complex-valued tensor from another

Each tensor is represented as a tuple of two real-valued tensors,corresponding to the real and imaginary part, respectively.

Parameters:
  • a (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – First tensor

  • b (typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]) – Second tensor which is substracted from the first

Return type:

typing.Tuple[drjit.cuda.ad.TensorXf,drjit.cuda.ad.TensorXf]

Electromagnetics

sionna.rt.utils.complex_relative_permittivity(eta_r,sigma,omega)[source]

Computes the complex relative permittivity of a materialas defined in(9)

Parameters:
  • eta_r (drjit.cuda.ad.Float) – Real component of the relative permittivity

  • sigma (drjit.cuda.ad.Float) – Conductivity [S/m]

  • omega (drjit.cuda.ad.Float) – Angular frequency [rad/s]

Return type:

drjit.cuda.ad.Complex2f

sionna.rt.utils.fresnel(x)[source]

Computes the complex-valued Fresnel integral

The complex-valued Fresnel integral is defined as:

(55)\[F_c(x) = \int_0^{\sqrt{\frac{2x}{\pi}}} \exp\left(j\frac{\pi s^2}{2}\right)ds = C(x) + jS(x)\]

This function computes an approximation of this integral as described inSection 2.7 of[ITU_R_P_526_15]. It has sufficient accuracy for mostpurposes. Note that we let the upper limit of the integral be\(\sqrt{2x/\pi}\) instead of\(x\), which is different from the definitionin[ITU_R_P_526_15]. Thus, evaluating\(F_c(x)\) corresponds to\(F_c(\sqrt{2x/\pi})\) in the classical definition.

Parameters:

x (drjit.cuda.ad.Float) – Argument of the Fresnel integral

Return type:

drjit.cuda.ad.Complex2f

Returns:

Complex-valued Fresnel integral

sionna.rt.utils.f_utd(x)[source]

Computes the UTD transition function

The UTD transition function is defined as:

\[F(x) = \sqrt{\frac{\pi x}{2}} e^{jx}\left(1+j-2jF_c^*(x) \right)\]

where\(F_c^*(x)\) is the complex conjugate of the Fresnel integral(55).

Parameters:

x (drjit.cuda.ad.Float) – Argument of the UTD transition function

Return type:

drjit.cuda.ad.Complex2f

Returns:

Real and imaginary parts of the UTD transition function

Example

The following code snippet produces a visualization of the magnitude and phase ofthe UTD transition function which matches that of Fig. 6 in[Kouyoumjian74].

importnumpyasnpimportmatplotlib.pyplotaspltimportdrjitasdrimportmitsubaasmimi.set_variant("cuda_ad_mono_polarized","llvm_ad_mono_polarized")fromsionna.rt.utilsimportf_utd,cpx_convertx=np.logspace(-3,1,1000)y=cpx_convert(f_utd(mi.Float(x)),"numpy")fig,ax1=plt.subplots(figsize=(10,6.5))# Plot magnitude with labelmag_line,=ax1.semilogx(x,np.abs(y),"k-",label="Magnitude")ax1.set_ylabel("Magnitude")# Create second y-axisax2=plt.twinx()# Plot phase with labelphase_line,=ax2.semilogx(x,np.angle(y,deg=True),"r--",label="Phase")ax2.set_ylabel("Phase (deg)")# Combine lines from both axes for the legendlines=[mag_line,phase_line]labels=[line.get_label()forlineinlines]# Add legend with both linesax1.legend(lines,labels,loc='upper center',frameon=True,ncol=2)# Set title and x labelplt.title(r"UTD Transition Function $F(x)$")ax1.set_xlabel("x")# Adjust limits and ticksax1.set_xlim(x.min(),x.max())ax1.set_ylim(np.abs(y).min(),np.abs(y).max())ax2.set_ylim(np.angle(y,deg=True).min(),np.angle(y,deg=True).max())ax1.set_yticks(np.linspace(0,1,6))ax2.set_yticks(np.linspace(0,50,11))plt.show()
../../_images/f_utd.png
sionna.rt.utils.fresnel_reflection_coefficients_simplified(cos_theta,eta)[source]

Computes the Fresnel transverse electric and magnetic reflectioncoefficients assuming an incident wave propagating in vacuum(34)

Parameters:
  • cos_theta (drjit.cuda.ad.Float) – Cosine of the angle of incidence

  • eta (drjit.cuda.ad.Complex2f) – Complex-valued relative permittivity of the medium upon which the wave is incident

Return type:

typing.Tuple[drjit.cuda.ad.Complex2f,drjit.cuda.ad.Complex2f]

Returns:

Transverse electric\(r_{\perp}\) and magnetic\(r_{\parallel}\) Fresnel reflection coefficients

sionna.rt.utils.itu_coefficients_single_layer_slab(cos_theta,eta,d,wavelength)[source]

Computes the single-layer slab Fresnel transverse electric andmagnetic reflection and refraction coefficients assuming the incident wavepropagates in vacuum using recommendation ITU-R P.2040 [ITU_R_2040_3]

More precisely, this function implements equations (43) and (44) from[ITU_R_2040_3].

Parameters:
  • cos_theta (drjit.cuda.ad.Float) – Cosine of the angle of incidence

  • eta (drjit.cuda.ad.Complex2f) – Complex-valued relative permittivity of the medium upon which the wave is incident

  • d (drjit.cuda.ad.Float) – Thickness of the slab [m]

  • wavelength (drjit.cuda.ad.Float) – Wavelength [m]

Return type:

typing.Tuple[drjit.cuda.ad.Complex2f,drjit.cuda.ad.Complex2f,drjit.cuda.ad.Complex2f,drjit.cuda.ad.Complex2f]

Returns:

Transverse electric reflection coefficient\(R_{eTE}\), transverse magnetic reflection coefficient\(R_{eTM}\), transverse electric refraction coefficient\(T_{eTE}\), and transverse magnetic refraction coefficient\(T_{eTM}\)

Geometry

sionna.rt.utils.phi_hat(phi)[source]

Computes the spherical unit vector\(\hat{\boldsymbol{\varphi}}(\theta, \varphi)\)as defined in(1)

Parameters:

phi (drjit.cuda.ad.Float) – Azimuth angle\(\varphi\) [rad]

Return type:

mitsuba.Vector3f

sionna.rt.utils.theta_hat(theta,phi)[source]

Computes the spherical unit vector\(\hat{\boldsymbol{\theta}}(\theta, \varphi)\)as defined in(1)

Parameters:
  • theta (drjit.cuda.ad.Float) – Zenith angle\(\theta\) [rad]

  • phi (drjit.cuda.ad.Float) – Azimuth angle\(\varphi\) [rad]

Return type:

mitsuba.Vector3f

sionna.rt.utils.r_hat(theta,phi)[source]

Computes the spherical unit vetor\(\hat{\mathbf{r}}(\theta, \phi)\)as defined in(1)

Parameters:
  • theta (drjit.cuda.ad.Float) – Zenith angle\(\theta\) [rad]

  • phi (drjit.cuda.ad.Float) – Azimuth angle\(\varphi\) [rad]

Return type:

mitsuba.Vector3f

sionna.rt.utils.theta_phi_from_unit_vec(v)[source]

Computes zenith and azimuth angles (\(\theta,\varphi\))from unit-norm vectors as described in(2)

Parameters:

v (mitsuba.Vector3f) – Unit vector

Return type:

typing.Tuple[drjit.cuda.ad.Float,drjit.cuda.ad.Float]

Returns:

Zenith angle\(\theta\) [rad] and azimuth angle\(\varphi\) [rad]

sionna.rt.utils.rotation_matrix(angles)[source]

Computes the rotation matrix as defined in(3)

The closed-form expression in (7.1-4)[TR38901] is used.

Parameters:

angles (mitsuba.Point3f) – Angles for the rotations\((\alpha,\beta,\gamma)\)[rad] that define rotations about the axes\((z, y, x)\),respectively

Return type:

drjit.cuda.ad.Matrix3f

Jones calculus

sionna.rt.utils.implicit_basis_vector(k)[source]

Returns a reference frame basis vector for a Jones vector, representing atransverse wave propagating in directionk

The spherical basis vector\(\hat{\boldsymbol{\theta}}(\theta, \varphi)\)(1) is used as basis vector, where the zenith and azimuth anglesare obtained from the unit vectork.

Parameters:

k (mitsuba.Vector3f) – A unit vector corresponding to the direction of propagation of a transverse wave

Return type:

mitsuba.Vector3f

Returns:

A basis vector orthogonal tok

sionna.rt.utils.jones_matrix_rotator(k,s_current,s_target)[source]

Constructs the 2D change-of-basis matrix to rotate the reference frame ofa Jones vector representing a transverse wave propagating in directionk from basis vectors_current to basisvectors_target

Parameters:
  • k (mitsuba.Vector3f) – Direction of propagation as a unit vector

  • s_current (mitsuba.Vector3f) – Current basis vector as a unit vector

  • s_target (mitsuba.Vector3f) – Target basis vector as a unit vector

Return type:

drjit.cuda.ad.Matrix2f

sionna.rt.utils.jones_matrix_rotator_flip_forward(k)[source]

Constructs the 2D change-of-basis matrix that flips the direction ofpropagation of the reference frame of a Jones vector representing atransverse wave from the basis vector corresponding tok to theone corresponding to-k

This is useful to evaluate the antenna pattern of a receiver, as the patternneeds to be rotated to match the frame in which the incident wave isrepresented.

Note that the rotation matrix returned by this function is a diagonalmatrix:

\[\begin{split}\mathbf{R} = \begin{bmatrix} \begin{array}{c c} c & 0 \\ 0 & -c \end{array} \end{bmatrix}\end{split}\]

where:

\[c = \mathbf{s_c}^\textsf{T} \mathbf{s_t}\]

and\(\mathbf{s_c}\) and\(\mathbf{s_t}\) are the basisvectors corresponding tok and-k,respectively, and computed usingimplicit_basis_vector().

Parameters:

k (mitsuba.Vector3f) – Current direction of propagation as a unit vector

Return type:

drjit.cuda.ad.Matrix2f

sionna.rt.utils.to_world_jones_rotator(to_world,k_local)[source]

Constructs the 2D change-of-basis matrix to rotate the reference frame ofa Jones vector representing a transverse wave withk_local asdirection of propagation from the local implicit frame to the world implicitframe

Parameters:
  • to_world (drjit.cuda.ad.Matrix3f) – Change-of-basis matrix from the local to the world frame

  • k_local (mitsuba.Vector3f) – Direction of propagation in the local frame as a unit vector

Return type:

drjit.cuda.ad.Matrix2f

sionna.rt.utils.jones_matrix_to_world_implicit(c1,c2,to_world,k_in_local,k_out_local)[source]

Builds the Jones matrix that models a specular reflection or a refraction

c1 andc2 are Fresnel coefficients that depend on thecomposition of the scatterer.k_in_local andk_out_local are the direction of propagation of theincident and scattered wave, respectively, represented in the local frame ofthe interaction.Note that in the local frame of the interaction, the z-axis vectorcorresponds to the normal to the scatterer surface at the interaction point.

The returned matrix operates on the incident wave represented in theimplicit world frame. The resulting scattered wave is also represented inthe implicit world frame.This is ensured by applying a left and right rotation matrix to the 2x2diagonal matrix containing the Fresnel coefficients, which operates on thelocal frame having the transverse electric component as basis vector:

\[\mathbf{J} = \mathbf{R_O} \mathbf{D} \mathbf{R_I}^\textsf{T}\]

where:

\[\begin{split}\mathbf{D} = \begin{bmatrix} \begin{array}{c c} \texttt{c1} & 0 \\ 0 & \texttt{c2} \end{array} \end{bmatrix}\end{split}\]

and\(\mathbf{R_I}\) (\(\mathbf{R_O}\)) is the change-of-basismatrix from the local frame using the transverse electric direction as basisvector to the world implicit frame for the incident (scattered) wave.

This function returns the\(4 \times 4\) real-valued matrix equivalentto\(\mathbf{J}\):

\[\begin{split}\mathbf{M} = \begin{bmatrix} \begin{array}{c c} \Re\{\mathbf{J}\} & -\Im\{\mathbf{J}\} \\ \Im\{\mathbf{J}\} & \Re\{\mathbf{J}\} \end{array} \end{bmatrix}\end{split}\]

where\(\mathbf{M}\) is the returned matrix and\(\Re\{\mathbf{J}\}\)and\(\Im\{\mathbf{J}\}\) the real and imaginary components of\(\mathbf{J}\), respectively.

Parameters:
  • c1 (drjit.cuda.ad.Complex2f) – First complex-valued Fresnel coefficient

  • c2 (drjit.cuda.ad.Complex2f) – Second complex-valued Fresnel coefficient

  • to_world (drjit.cuda.ad.Matrix3f) – Change-of-basis matrix from the local to the world frame

  • k_in_local (mitsuba.Vector3f) – Direction of propagation of the incident wave in the local frame as a unit vector

  • k_out_local (mitsuba.Vector3f) – Direction of propagation of the scattered wave in the local frame as a unit vector

Return type:

drjit.cuda.ad.Matrix4f

sionna.rt.utils.jones_vec_dot(u,v)[source]

Computes the dot product of two Jones vectors\(\mathbf{u}\) and\(\mathbf{v}\)

A Jones vector is assumed to be represented by a real-valued vector offour dimensions, obtained by concatenating its real and imaginary components.The returned array is complex-valued.

More precisely, the following formula is implemented:

\[\begin{split}\begin{multline}a = \mathbf{u}^\textsf{H} \mathbf{v}\\ = \left( \Re\{\mathbf{u}\}^\textsf{T} \Re\{\mathbf{v}\}\\ + \Im\{\mathbf{u}\}^\textsf{T} \Im\{\mathbf{v}\} \right)\\ + j\left( \Re\{\mathbf{u})^\textsf{T} \Im\{\mathbf{v}\}\\ - \Im\{\mathbf{u}\}^\textsf{T} \Re\{\mathbf{v}\} \right)\end{multline}\end{split}\]
Parameters:
  • u (mitsuba.Vector4f) – First input vector

  • v (mitsuba.Vector4f) – Second input vector

Return type:

drjit.cuda.ad.Complex2f

Meshes

sionna.rt.utils.load_mesh(fname,flip_normals=True)[source]

Load a mesh from a file

This function loads a mesh from a given file and returns it as a Mitsuba mesh.The file must be in either PLY or OBJ format.

Parameters:
  • fname (str) – Filename of the mesh to be loaded

  • flip_normals (bool) – Whether to invert the normals of the mesh.

Return type:

mitsuba.Mesh

Returns:

Mitsuba mesh object representing the loaded mesh

sionna.rt.utils.transform_mesh(mesh,translation=None,rotation=None,scale=None)[source]

In-place transformation of a mesh by applying translation, rotation, and scaling

The order of the transformations is as follows:

  1. Scaling

  2. Rotation

  3. Translation

Before applying the transformations, the mesh is centered.

Parameters:
  • mesh (mitsuba.Mesh) – Mesh to be edited. The mesh is modified in-place.

  • translation (typing.Optional[mitsuba.Point3f]) – Translation vector to apply

  • rotation (typing.Optional[mitsuba.Point3f]) – Rotation angles [rad] specified through three angles\((\alpha, \beta, \gamma)\) corresponding to a 3D rotation as defined in(3)

  • scale (typing.Optional[mitsuba.Point3f]) – Scaling vector for scaling along the x, y, and z axes

Miscellaneous

sionna.rt.utils.complex_sqrt(x)[source]

Computes the square root of a complex number\(x\)

The following formula is implemented to compute the square roots of complexnumbers:https://en.wikipedia.org/wiki/Square_root#Algebraic_formula

Parameters:

x (drjit.cuda.ad.Complex2f) – Complex number

Return type:

drjit.cuda.ad.Complex2f

sionna.rt.utils.dbm_to_watt(x)[source]

Converts dBm to Watt

Implements the following formula:

\[P_W = 10^{\frac{P_{dBm}-30}{10}}\]
Parameters:

x (drjit.cuda.ad.Float) – Power [dBm]

Return type:

drjit.cuda.ad.Float

sionna.rt.utils.isclose(a,b,rtol=1e-05,atol=1e-08)[source]

Returns an array of boolean in which an element is set toTrue if thecorresponding entries ina andb are equal within a tolerance

More precisely, this function returnsTrue for the\(i^{th}\) elementif:

\[|\texttt{a}[i] - \texttt{b}[i]| < \texttt{atol} + \texttt{rtol} \cdot \texttt{b}[i]\]
Parameters:
  • a (drjit.cuda.ad.Float) – First input array to compare

  • b (drjit.cuda.ad.Float) – Second input array to compare

  • rtol (drjit.cuda.ad.Float) – Relative error threshold

  • atol (drjit.cuda.ad.Float) – Absolute error threshold

Return type:

drjit.cuda.ad.Bool

sionna.rt.utils.log10(x)[source]

Evaluates the base-10 logarithm

Parameters:

x (drjit.cuda.ad.Float) – Input value

Return type:

drjit.cuda.ad.Float

sionna.rt.utils.sigmoid(x)[source]

Evaluates the sigmoid ofx

Parameters:

x (drjit.cuda.ad.Float) – Input value

Return type:

drjit.cuda.ad.Float

sionna.rt.utils.sinc(x)[source]

Evaluates the normalized sinc function

The sinc function is defined as\(\sin(\pi x)/(\pi x)\)for any\(x \neq 0\) and equals\(0\) for\(x=0\).

Return type:

drjit.cuda.ad.Float

Parameters:

x (Float)

sionna.rt.utils.subcarrier_frequencies(num_subcarriers,subcarrier_spacing)[source]

Compute the baseband frequencies ofnum_subcarrier subcarriers spaced bysubcarrier_spacing, i.e.,

>>># If num_subcarrier is even:>>>frequencies=[-num_subcarrier/2,...,0,...,num_subcarrier/2-1]*subcarrier_spacing>>>>>># If num_subcarrier is odd:>>>frequencies=[-(num_subcarrier-1)/2,...,0,...,(num_subcarrier-1)/2]*subcarrier_spacing
Parameters:
  • num_subcarriers (int) – Number of subcarriers

  • subcarrier_spacing (float) – Subcarrier spacing [Hz]

Return type:

drjit.cuda.ad.Float

Returns:

Baseband frequencies of subcarriers

sionna.rt.utils.watt_to_dbm(x)[source]

Converts Watt to dBm

Implements the following formula:

\[P_{dBm} = 30 + 10 \log_{10}(P_W)\]
Parameters:

x (drjit.cuda.ad.Float) – Power [W]

Return type:

drjit.cuda.ad.Float

Ray tracing

sionna.rt.utils.fibonacci_lattice(num_points)[source]

Generates a Fibonacci lattice of sizenum_points on the unit square\([0, 1] \times [0, 1]\)

Parameters:

num_points (int) – Size of the lattice

Return type:

mitsuba.Point2f

sionna.rt.utils.spawn_ray_from_sources(lattice,samples_per_src,src_positions)[source]

Spawnssamples_per_src rays for each source at the positions specifiedbysrc_positions, oriented in the directions defined by thelattice

The spawned rays are ordered samples-first.

Parameters:
  • lattice (typing.Callable[[int],mitsuba.Point2f]) – Callable that generates the lattice used as directions forthe rays

  • samples_per_src (int) – Number of rays per source to spawn

  • src_positions (mitsuba.Point3f) – Positions of the sources

Return type:

mitsuba.Ray3f

sionna.rt.utils.offset_p(p,d,n)[source]

Adds a small offset to\(\mathbf{p}\) along\(\mathbf{n}\) such that\(\mathbf{n}^{\textsf{T}} \mathbf{d} \gt 0\)

More precisely, this function returns\(\mathbf{o}\) such that:

\[\mathbf{o} = \mathbf{p} + \epsilon\left(1 + \max{\left\{|p_x|,|p_y|,|p_z|\right\}}\right)\texttt{sign}(\mathbf{d} \cdot \mathbf{n})\mathbf{n}\]

where\(\epsilon\) depends on the numerical precision and\(\mathbf{p} = (p_x,p_y,p_z)\).

Parameters:
  • p (mitsuba.Point3f) – Point to offset

  • d (mitsuba.Vector3f) – Direction toward which to offset alongn

  • n (mitsuba.Vector3f) – Direction along which to offset

Return type:

mitsuba.Point3f

sionna.rt.utils.spawn_ray_towards(p,t,n=None)[source]

Spawns a ray with infinite length from\(\mathbf{p}\) toward\(\mathbf{t}\)

If\(\mathbf{n}\) is notNone, then a small offset is addedto\(\mathbf{p}\) along\(\mathbf{n}\) in the direction of\(\mathbf{t}\).

Parameters:
  • p (mitsuba.Point3f) – Origin of the ray

  • t (mitsuba.Point3f) – Point towards which to spawn the ray

  • n (typing.Optional[mitsuba.Vector3f]) – (Optional) Direction along which to offset\(\mathbf{p}\)

Return type:

mitsuba.Ray3f

sionna.rt.utils.spawn_ray_to(p,t,n=None)[source]

Spawns a finite ray from\(\mathbf{p}\) to\(\mathbf{t}\)

The length of the ray is set to\(\|\mathbf{p} - \mathbf{t}\|\).

If\(\mathbf{n}\) is notNone, then a small offset is addedto\(\mathbf{p}\) along\(\mathbf{n}\) in the direction of\(\mathbf{t}\).

Parameters:
  • p (mitsuba.Point3f) – Origin of the ray

  • t (mitsuba.Point3f) – Point towards which to spawn the ray

  • n (typing.Optional[mitsuba.Vector3f]) – (Optional) Direction along which to offset\(\mathbf{p}\)

Return type:

mitsuba.Ray3f

References:
[ITU_R_P_526_15](1,2)

Recommendation ITU-R P.526-15, “Propagation bydiffraction