Fungrim home page

Fungrim entry: 22fb4a

atan2 ⁣(y,x)={0,x=y=0atan ⁣(yx),x>0(π2)sgn ⁣(y)atan ⁣(xy),y0π,y=0andx<0\operatorname{atan2}\!\left(y, x\right) = \begin{cases} 0, & x = y = 0\\\operatorname{atan}\!\left(\frac{y}{x}\right), & x > 0\\\left(\frac{\pi}{2}\right) \operatorname{sgn}\!\left(y\right) - \operatorname{atan}\!\left(\frac{x}{y}\right), & y \ne 0\\\pi, & y = 0 \,\mathbin{\operatorname{and}}\, x < 0\\ \end{cases}
Assumptions:xRandyRx \in \mathbb{R} \,\mathbin{\operatorname{and}}\, y \in \mathbb{R}
TeX:
\operatorname{atan2}\!\left(y, x\right) = \begin{cases} 0, & x = y = 0\\\operatorname{atan}\!\left(\frac{y}{x}\right), & x > 0\\\left(\frac{\pi}{2}\right) \operatorname{sgn}\!\left(y\right) - \operatorname{atan}\!\left(\frac{x}{y}\right), & y \ne 0\\\pi, & y = 0 \,\mathbin{\operatorname{and}}\, x < 0\\ \end{cases}

x \in \mathbb{R} \,\mathbin{\operatorname{and}}\, y \in \mathbb{R}
Definitions:
Fungrim symbol Notation Short description
Atan2atan2 ⁣(y,x)\operatorname{atan2}\!\left(y, x\right) Two-argument inverse tangent
Atanatan ⁣(z)\operatorname{atan}\!\left(z\right) Inverse tangent
ConstPiπ\pi The constant pi (3.14...)
Signsgn ⁣(z)\operatorname{sgn}\!\left(z\right) Sign function
RRR\mathbb{R} Real numbers
Source code for this entry:
Entry(ID("22fb4a"),
    Formula(Equal(Atan2(y, x), Cases(Tuple(0, Equal(x, y, 0)), Tuple(Atan(Div(y, x)), Greater(x, 0)), Tuple(Sub(Mul(Parentheses(Div(ConstPi, 2)), Sign(y)), Atan(Div(x, y))), Unequal(y, 0)), Tuple(ConstPi, And(Equal(y, 0), Less(x, 0)))))),
    Variables(x, y),
    Assumptions(And(Element(x, RR), Element(y, RR))))

Topics using this entry

Copyright (C) Fredrik Johansson and contributors. Fungrim is provided under the MIT license. The source code is on GitHub.

2019-09-16 21:17:18.797188 UTC