ProtoFlux:Atan2: Difference between revisions

From Resonite Wiki
Create page and add basic information
 
Fix link to Rad 2 Deg
Line 15: Line 15:
The '''Atan2''' node returns the [https://en.wikipedia.org/wiki/Atan2| 2-argument arctangent] of the point with the input X and Y coordinates. The output value is the angle between the positive x axis and the point in [https://en.wikipedia.org/wiki/Cartesian_coordinate_system| the Cartesian coordinate system].
The '''Atan2''' node returns the [https://en.wikipedia.org/wiki/Atan2| 2-argument arctangent] of the point with the input X and Y coordinates. The output value is the angle between the positive x axis and the point in [https://en.wikipedia.org/wiki/Cartesian_coordinate_system| the Cartesian coordinate system].


{{Template:Note|The output value is in [https://en.wikipedia.org/wiki/Radian radians]. If you want a value in degrees, multiply by the [[ProtoFlux:RadToDeg | RadToDeg]] node.|suggestion}}
{{Template:Note|The output value is in [https://en.wikipedia.org/wiki/Radian radians]. If you want a value in degrees, multiply by the [[ProtoFlux:Rad_2_Deg | Rad 2 Deg]] node.|suggestion}}


== Variants ==
== Variants ==

Revision as of 05:51, 26 May 2024

Atan2
Y
*
X
Trigonometry

The Atan2 node returns the 2-argument arctangent of the point with the input X and Y coordinates. The output value is the angle between the positive x axis and the point in the Cartesian coordinate system.

The output value is in radians. If you want a value in degrees, multiply by the Rad 2 Deg node.

Variants

There are many variants of this node. The simplest take 2 scalar numeric-typed values. Some more complicated variants take one scalar and one vector or two same-sized vectors. In each case, the output has the same dimensions as the highest dimension input. Values are calculated element-wise, for example:

If the input Y is 1 and input X is [2;3] the output will be [Atan2(1,2);Atan2(1,3)].

Similarly if the input Y is [1;2] and the input X is [3;4] the output will be [Atan2(1,3);Atan2(2,4)].

Inputs

Y (Pseudo-Generic)

Input Y coordinate value.

X (Pseudo-Generic)

Input X coordinate value.

Outputs

* (Pseudo-Generic)

2-argument arctangent of Y and X.