Can math.atan2 return INF?

Pierre-Alain Dorange pdorange at pas-de-pub-merci.mac.com
Thu Jun 23 13:07:43 EDT 2016


Dan Sommers <dan at tombstonezero.net> wrote:

> > Given:
> > 
> > x = INF
> > y = INF
> > assert x == y
> > 
> > there is a reason to pick atan2(y, x) = pi/4:
> > 
> > Since x == y, the answer should be the same as for any other pair of x == y.
> 
> When x == y == 0, then atan2(y, x) is 0.

This is the only solution (0) where atan2 return sometime else than
pi/4. And INF is not 0, it can be lot of values, but not zero.

Yes x=INF and y=INF do not mean x=y (in math world) but INF is a
frontier that can be reach, so it tend to the maximum value. So the
tendancy is always atan2(y,x) tend to pi/4 if you looks at lot od y and
x that will be grater and greater each time : the final frontier would
always be pi/4, even if t take a long time to reach it.

-- 
Pierre-Alain Dorange        <http://microwar.sourceforge.net/>

Ce message est sous licence Creative Commons "by-nc-sa-2.0"
        <http://creativecommons.org/licenses/by-nc-sa/2.0/fr/>



More information about the Python-list mailing list