#16439: Allow inverse trig functions to all take complex input
-----------------------------+------------------------
       Reporter:  kcrisman   |        Owner:
           Type:  defect     |       Status:  new
       Priority:  minor      |    Milestone:  sage-6.3
      Component:  symbolics  |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+------------------------

Comment (by kcrisman):

 > Why don't complex numbers have these attributes? This should be possible
 - for example wolfram alpha
 [http://www.wolframalpha.com/input/?i=acos%281%2F%28-0.9+%2B+i%29%29 gives
 a value] for `acos(-0.9+i)`.
 Complex number ''do'' have these attributes, just not the minimalist
 `complex` Python data type.
 {{{
 sage: a = complex(1,1)
 sage: a.[tab]
 a.conjugate  a.imag       a.real
 sage: a._[tab]
 a.__abs__           a.__hash__          a.__rdivmod__
 a.__add__           a.__init__          a.__reduce__
 a.__class__         a.__int__           a.__reduce_ex__
 a.__coerce__        a.__le__            a.__repr__
 a.__delattr__       a.__long__          a.__rfloordiv__
 a.__div__           a.__lt__            a.__rmod__
 a.__divmod__        a.__mod__           a.__rmul__
 a.__doc__           a.__mul__           a.__rpow__
 a.__eq__            a.__ne__            a.__rsub__
 a.__float__         a.__neg__           a.__rtruediv__
 a.__floordiv__      a.__new__           a.__setattr__
 a.__format__        a.__nonzero__       a.__sizeof__
 a.__ge__            a.__pos__           a.__str__
 a.__getattribute__  a.__pow__           a.__sub__
 a.__getnewargs__    a.__radd__          a.__subclasshook__
 a.__gt__            a.__rdiv__          a.__truediv__
 }}}
 And the built-in `math` module doesn't do `arcsec`
 {{{
 sage: math.a[tab]
 math.acos   math.asin   math.atan   math.atanh
 math.acosh  math.asinh  math.atan2
 }}}
 and even then only takes ones with real output
 {{{
 sage: math.acos(1)
 0.0
 sage: math.acos(2)
 ValueError: math domain error
 sage: math.acos(a)
 TypeError: can't convert complex to float
 }}}
 > I think the computations should be performed using `CDF` and then
 coerced back to `complex`. Complex output from these functions should be
 handled by the plot function separately.
 Maybe.  Is `CDF` basically the same as `complex`?  Is there precedent for
 this?

--
Ticket URL: <http://trac.sagemath.org/ticket/16439#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to