Arc Tangent 2

Overview

The Arc Tangent 2 Node takes two Float values, yy and xx, and returns atan2(y,x)atan2(y,x). The result can be obtained in degrees (°) or radians (rad).

The function atan2(y,x)atan2(y,x) is of common use in computer science and can be equivalently defined as:

  • The angle θ\theta in the Euclidean plane between the positive XX axis and the ray connecting the origin and the point (x,y)(x,y).

  • The phase θ\theta of the complex number x+iyx+iy. That is, the angle θ(π,π]\theta \in (-\pi, \pi] such that x=rcosθx=r\cos\theta and y=rsinθy=r\sin\theta, where r=x2+y2r=\sqrt{x^2+y^2}.

Scope: Project, Scene, Function, Prefab.

Attributes

Miscellaneous

AttributeTypeDescription

Is Degree

Bool

Determines whether the Output value is given in degrees (°) or radians (rad).

Default Value y

Float

The default value of y, if no value is provided in the Input Socket.

Default Value x

Float

The default value of x, if no value is provided in the Input Socket.

Inputs

InputTypeDescription

Pulse Input (►)

Pulse

A standard Input Pulse, to trigger the execution of the Node.

y

Float

The yy input value.

x

Float

The xx input value.

Outputs

OutputTypeDescription

Pulse Output (►)

Pulse

A standard Output Pulse, to move onto the next Node along the Logic Branch, once this Node has finished its execution.

Output

Float

The value of atan2(y,x)atan2(y,x), either in degrees (°) or radians (rad), according to the Is Degree Attribute.

See Also

Last updated