#include <math_ops.h>
Computes arctangent of y/x element-wise, respecting signs of the arguments.
This is the angle \( \theta \in [-\pi, \pi] \) such that \[ x = r \cos(\theta) \] and \[ y = r \sin(\theta) \] where \(r = \sqrt{x^2 + y^2} \).
For example:
x = [1., 1.] y = [1., -1.] print((tf.math.atan2(y,x) * (180 / np.pi)).numpy()) [ 45. -45.]
Args:
Returns:
Output: The z tensor. | Constructors and Destructors | |
|---|---|
Atan2(const ::tensorflow::Scope & scope, ::tensorflow::Input y, ::tensorflow::Input x) |
| Public attributes | |
|---|---|
operation | |
z | |
| Public functions | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
Operation operation
::tensorflow::Output z
Atan2( const ::tensorflow::Scope & scope, ::tensorflow::Input y, ::tensorflow::Input x )
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output() const
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/atan2