mindspore.ops.Polar
- class mindspore.ops.Polar[source]
Converts polar coordinates to Cartesian coordinates.
Refer to
mindspore.ops.polar()
for more details.- Inputs:
abs (Tensor) - Radial distance. The shape of tensor is \((N,*)\) where \(N\) means the batchsize of the input tensor, \(*\) means, any number of additional dimensions. Must be one of the following types: float32, float64.
angle (Tensor) - Polar angle. It has the same shape and dtype as abs.
- Outputs:
Tensor, has the same shape and data type as abs.
- Supported Platforms:
GPU
CPU
Examples
>>> polar = ops.Polar() >>> x1 = Tensor(np.array([1, 2]), mindspore.float64) >>> x2 = Tensor(np.array([3, 4]), mindspore.float64) >>> output = polar(x1, x2) >>> print(output) [-0.9899925 +0.14112001j -1.30728724-1.51360499j]