HUGO
Menu
GitHub 90265 stars Mastodon

math.Atan2

Returns the arctangent, in radians, of the given number pair, determining the correct quadrant from their signs.
Syntax
math.Atan2 VALUE VALUE
Returns
float64

Usage

The math.Atan2 function returns the arctangent, in radians, of the first number divided by the second number. The function uses the signs of both numbers to determine the quadrant of the returned value.

Examples

{{ math.Atan2 1 2 }} → 0.4636476090008061

With negative numbers:

{{ math.Atan2 -1 -2 }} → -2.677945044588987