Skip to content

Make atan2(0,0) consistent #11423

@kcrisman

Description

@kcrisman

This is bad:

    sage: atan2(0,0)
    0
    sage: atan2(0,0,hold=True)
    arctan2(0, 0)
    sage: atan2(0,0,hold=True).n()
    ValueError: arctan2(0,0) undefined
    sage: atan2(0,0,hold=True).simplify()
    -----------------------------------------------------
    TypeError: Error executing code in Maxima
    CODE:
    sage1 : atan2(0,0)$
    Maxima ERROR:
    
    atan2: atan2(0,0) is undefined.
     -- an error. To debug this try: debugmode(true);

Probably we should make sure that atan2(0,0) always raises an error. Wolfram Alpha/Mathematica gives the interval from -pi to pi, which seems as good as any answer, and who knows what others do.

Originally reported at ask.sagemath.org.

CC: @sagetrac-titusn

Component: symbolics

Keywords: sd31

Reviewer: Volker Braun, Titus Nicolae, Burcin Erocal

Issue created by migration from https://trac.sagemath.org/ticket/11423

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions