megengine.functional.polar¶
- polar(abs, angle)[source]¶
Constructs a complex tensor whose elements are Cartesian coordinates corresponding to the polar coordinates with absolute value abs and angle angle.
- Parameters
- Return type
- Returns
the complex tensor
Examples
>>> abs = Tensor([1, 2], dtype=np.float32) >>> angle = Tensor([np.pi / 2, 5 * np.pi / 4], dtype=np.float32) >>> z = F.polar(abs, angle) >>> z Tensor([-4.3711e-08+1.j -1.4142e+00-1.4142j], dtype=complex64, device=xpux:0)