On this page
  1. math.atan2
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

math.atan2

Prev: math.atan | Up: math | Next: math.atanh
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.atan2
Tags: #public #python3 #stdlib #math


Import

import math
from math import atan2

Signature & Overview

math.atan2(y, x, /)

Return the arc tangent (measured in radians) of y/x.

Usage

import math

# Note parameter order: atan2(y, x), NOT (x, y)
assert math.isclose(math.atan2(1.0, -1.0), 3 * math.pi / 4)
assert math.isclose(math.atan2(0.0, -1.0), math.pi)

Gotchas

REPL Inspect

from math import atan2
help(atan2)

Linked from

Related notes