Skip to main content

math.atan2(adjacentLength, oppositeLength)

Returns the arc-tangent

Availability

Device + Agent

Parameters

Name Type Description
adjacentLength Float The length of the adjacent side of a right-angled triangle
oppositeLength Float The length of the opposite side of a right-angled triangle

Returns

Float — an angle in Radians

Description

This function returns the arc-tangent of the two passed values, which are equivalent to the lengths of the adjacent and opposite sides of a right-angled triangle. The arc-tangent is equal to the angle formed between the adjacent side and the hypotenuse of the same triangle.

The angle is given in radians. To convert it to degrees, multiple the angle value by 180 and divide by π, represented in Squirrel by the constant PI.

Example Code