Standard library / math
math.Atan2()
Angle in radians for vector (x,y), using both signs to identify quadrant. Expected stdout: '1.570796\n'.
Formal Syntax & Structure
go syntaxgo
func Atan2(y, x float64) float64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| y | float64 | Second input operand. |
| x | float64 | First input operand (or sole input if unary). |
Return Value
float64
Angle in radians for vector (x,y), using both signs to identify quadrant.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Printf("%.6f\n", math.Atan2(1, 0))}