Skip to content

Commit 2d67964

Browse files
author
Release Manager
committed
gh-38853: Add conversion dictionaries to trig.py Add conversions of `tan`, `cot`, `sec`, and `csc` functions to `trig.py` to allow conversions from Mathematica, FriCAS, Maxima, Giac, and SymPy. The conversion dictionaries were present in other trigonometric functions but (quite surprisingly for me) absent in the above-mentioned four cases. Fixes #38852. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> No additional dependency. URL: #38853 Reported by: Jiří Janek Reviewer(s):
2 parents 47b74f7 + 05d89d7 commit 2d67964

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/sage/functions/trig.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ def __init__(self):
261261
sage: tan(2+I).imag().n() # needs sage.symbolic
262262
1.16673625724092
263263
"""
264-
GinacFunction.__init__(self, 'tan', latex_name=r"\tan")
264+
GinacFunction.__init__(self, 'tan', latex_name=r"\tan",
265+
conversions=dict(maxima='tan', mathematica='Tan',
266+
giac='tan', fricas='tan', sympy='tan'))
265267

266268

267269
tan = Function_tan()
@@ -349,7 +351,9 @@ def __init__(self):
349351
sage: cot(1.+I) # needs sage.symbolic
350352
0.217621561854403 - 0.868014142895925*I
351353
"""
352-
GinacFunction.__init__(self, 'cot', latex_name=r"\cot")
354+
GinacFunction.__init__(self, 'cot', latex_name=r"\cot",
355+
conversions=dict(maxima='cot', mathematica='Cot',
356+
giac='cot', fricas='cot', sympy='cot'))
353357

354358
def _eval_numpy_(self, x):
355359
"""
@@ -421,7 +425,9 @@ def __init__(self):
421425
sage: sec(complex(1,1)) # rel tol 1e-15 # needs sage.rings.complex_double
422426
(0.49833703055518686+0.5910838417210451j)
423427
"""
424-
GinacFunction.__init__(self, 'sec', latex_name=r"\sec")
428+
GinacFunction.__init__(self, 'sec', latex_name=r"\sec",
429+
conversions=dict(maxima='sec', mathematica='Sec',
430+
giac='sec', fricas='sec', sympy='sec'))
425431

426432
def _eval_numpy_(self, x):
427433
"""
@@ -493,7 +499,9 @@ def __init__(self):
493499
sage: csc(complex(1,1)) # rel tol 1e-15 # needs sage.rings.complex_double
494500
(0.6215180171704284-0.30393100162842646j)
495501
"""
496-
GinacFunction.__init__(self, 'csc', latex_name=r"\csc")
502+
GinacFunction.__init__(self, 'csc', latex_name=r"\csc",
503+
conversions=dict(maxima='csc', mathematica='Csc',
504+
giac='csc', fricas='csc', sympy='csc'))
497505

498506
def _eval_numpy_(self, x):
499507
"""

0 commit comments

Comments
 (0)