Skip to content

Commit

Permalink
Add conversion dictionaries to trig.py
Browse files Browse the repository at this point in the history
Add conversion of tan, cot, sec and csc functions to trig.py
  • Loading branch information
janekj2727 authored Oct 25, 2024
1 parent 7726cd9 commit 02f96fe
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/sage/functions/trig.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ def __init__(self):
sage: tan(2+I).imag().n() # needs sage.symbolic
1.16673625724092
"""
GinacFunction.__init__(self, 'tan', latex_name=r"\tan")
GinacFunction.__init__(self, 'tan', latex_name=r"\tan",
conversions=dict(maxima='tan', mathematica='Tan',
giac='tan', fricas='tan', sympy='tan'))


tan = Function_tan()
Expand Down Expand Up @@ -349,7 +351,9 @@ def __init__(self):
sage: cot(1.+I) # needs sage.symbolic
0.217621561854403 - 0.868014142895925*I
"""
GinacFunction.__init__(self, 'cot', latex_name=r"\cot")
GinacFunction.__init__(self, 'cot', latex_name=r"\cot",
conversions=dict(maxima='cot', mathematica='Cot',
giac='cot', fricas='cot', sympy='cot'))

def _eval_numpy_(self, x):
"""
Expand Down Expand Up @@ -421,7 +425,9 @@ def __init__(self):
sage: sec(complex(1,1)) # rel tol 1e-15 # needs sage.rings.complex_double
(0.49833703055518686+0.5910838417210451j)
"""
GinacFunction.__init__(self, 'sec', latex_name=r"\sec")
GinacFunction.__init__(self, 'sec', latex_name=r"\sec",
conversions=dict(maxima='sec', mathematica='Sec',
giac='sec', fricas='sec', sympy='sec'))

def _eval_numpy_(self, x):
"""
Expand Down Expand Up @@ -493,7 +499,9 @@ def __init__(self):
sage: csc(complex(1,1)) # rel tol 1e-15 # needs sage.rings.complex_double
(0.6215180171704284-0.30393100162842646j)
"""
GinacFunction.__init__(self, 'csc', latex_name=r"\csc")
GinacFunction.__init__(self, 'csc', latex_name=r"\csc",
conversions=dict(maxima='csc', mathematica='Csc',
giac='csc', fricas='csc', sympy='csc'))

def _eval_numpy_(self, x):
"""
Expand Down

0 comments on commit 02f96fe

Please sign in to comment.