Skip to contents

Element-wise two-argument arctangent, i.e. the angle (in radians) between the positive x-axis and the point (rhs, lhs).

Usage

nv_atan2(lhs, rhs)

Arguments

lhs, rhs

(tensorish)
Left and right operand. Operands are promoted to a common data type. Scalars are broadcast to the shape of the other operand.

Value

tensorish
Has the same shape and the promoted common data type of the inputs.

See also

nvl_atan2() for the underlying primitive.

Examples

jit_eval({
  y <- nv_tensor(c(1, 0, -1))
  x <- nv_tensor(c(0, 1, 0))
  nv_atan2(y, x)
})
#> AnvilTensor
#>   1.5708
#>   0.0000
#>  -1.5708
#> [ CPUf32{3} ]