Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/functions/trig.py
4048 views
1
"""
2
Trigonometric Functions
3
"""
4
from sage.symbolic.function import BuiltinFunction, GinacFunction
5
from sage.symbolic.expression import is_Expression
6
import math
7
8
class Function_sin(GinacFunction):
9
def __init__(self):
10
"""
11
The sine function.
12
13
EXAMPLES::
14
15
sage: sin(0)
16
0
17
sage: sin(x).subs(x==0)
18
0
19
sage: sin(2).n(100)
20
0.90929742682568169539601986591
21
sage: loads(dumps(sin))
22
sin
23
24
We can prevent evaluation using the ``hold`` parameter::
25
26
sage: sin(0,hold=True)
27
sin(0)
28
29
To then evaluate again, we currently must use Maxima via
30
:meth:`sage.symbolic.expression.Expression.simplify`::
31
32
sage: a = sin(0,hold=True); a.simplify()
33
0
34
35
TESTS::
36
37
sage: conjugate(sin(x))
38
sin(conjugate(x))
39
"""
40
GinacFunction.__init__(self, "sin", latex_name=r"\sin",
41
conversions=dict(maxima='sin',mathematica='Sin'))
42
43
sin = Function_sin()
44
45
class Function_cos(GinacFunction):
46
def __init__(self):
47
"""
48
The cosine function.
49
50
EXAMPLES::
51
52
sage: cos(pi)
53
-1
54
sage: cos(x).subs(x==pi)
55
-1
56
sage: cos(2).n(100)
57
-0.41614683654714238699756822950
58
sage: loads(dumps(cos))
59
cos
60
61
We can prevent evaluation using the ``hold`` parameter::
62
63
sage: cos(0,hold=True)
64
cos(0)
65
66
To then evaluate again, we currently must use Maxima via
67
:meth:`sage.symbolic.expression.Expression.simplify`::
68
69
sage: a = cos(0,hold=True); a.simplify()
70
1
71
72
TESTS::
73
74
sage: conjugate(cos(x))
75
cos(conjugate(x))
76
"""
77
GinacFunction.__init__(self, "cos", latex_name=r"\cos",
78
conversions=dict(maxima='cos',mathematica='Cos'))
79
80
cos = Function_cos()
81
82
class Function_tan(GinacFunction):
83
def __init__(self):
84
"""
85
The tangent function
86
87
EXAMPLES::
88
89
sage: tan(pi)
90
0
91
sage: tan(3.1415)
92
-0.0000926535900581913
93
sage: tan(3.1415/4)
94
0.999953674278156
95
sage: tan(pi/4)
96
1
97
sage: tan(1/2)
98
tan(1/2)
99
sage: RR(tan(1/2))
100
0.546302489843790
101
102
We can prevent evaluation using the ``hold`` parameter::
103
104
sage: tan(pi/4,hold=True)
105
tan(1/4*pi)
106
107
To then evaluate again, we currently must use Maxima via
108
:meth:`sage.symbolic.expression.Expression.simplify`::
109
110
sage: a = tan(pi/4,hold=True); a.simplify()
111
1
112
113
TESTS::
114
115
sage: conjugate(tan(x))
116
tan(conjugate(x))
117
"""
118
GinacFunction.__init__(self, "tan", latex_name=r"\tan")
119
120
tan = Function_tan()
121
122
class Function_sec(BuiltinFunction):
123
def __init__(self):
124
"""
125
The secant function
126
127
EXAMPLES::
128
129
sage: sec(pi/4)
130
sqrt(2)
131
sage: RR(sec(pi/4))
132
1.41421356237310
133
sage: n(sec(pi/4),100)
134
1.4142135623730950488016887242
135
sage: sec(1/2)
136
sec(1/2)
137
sage: sec(0.5)
138
1.13949392732455
139
140
sage: latex(sec(x))
141
\sec\left(x\right)
142
143
We can prevent evaluation using the ``hold`` parameter::
144
145
sage: sec(pi/4,hold=True)
146
sec(1/4*pi)
147
148
To then evaluate again, we currently must use Maxima via
149
:meth:`sage.symbolic.expression.Expression.simplify`::
150
151
sage: a = sec(pi/4,hold=True); a.simplify()
152
sqrt(2)
153
154
"""
155
BuiltinFunction.__init__(self, "sec", latex_name=r"\sec")
156
157
def _evalf_(self, x, parent=None):
158
"""
159
EXAMPLES::
160
161
sage: n(sec(pi/4),100)
162
1.4142135623730950488016887242
163
sage: float(sec(pi/4))
164
1.4142135623730951
165
"""
166
if parent is float:
167
return 1/math.cos(x)
168
return (1 / x.cos())
169
170
def _eval_numpy_(self, x):
171
"""
172
EXAMPLES::
173
174
sage: import numpy
175
sage: a = numpy.arange(2, 5)
176
sage: sec(a)
177
array([-2.40299796, -1.01010867, -1.52988566])
178
"""
179
return 1 / cos(x)
180
181
def _eval_(self, x):
182
"""
183
EXAMPLES::
184
185
sage: sec(pi/4)
186
sqrt(2)
187
sage: sec(x).subs(x==pi/4)
188
sqrt(2)
189
sage: sec(pi/7)
190
sec(1/7*pi)
191
sage: sec(x)
192
sec(x)
193
"""
194
cos_x = cos(x)
195
if is_Expression(cos_x) and cos_x.operator() is cos:
196
return None
197
else:
198
return 1/cos_x
199
200
def _derivative_(self, x, diff_param=None):
201
"""
202
EXAMPLES::
203
204
sage: bool(diff(sec(x), x) == diff(1/cos(x), x))
205
True
206
sage: diff(sec(x), x)
207
tan(x)*sec(x)
208
"""
209
return sec(x)*tan(x)
210
211
sec = Function_sec()
212
213
class Function_csc(BuiltinFunction):
214
def __init__(self):
215
"""
216
The cosecant function.
217
218
EXAMPLES::
219
220
sage: csc(pi/4)
221
sqrt(2)
222
sage: RR(csc(pi/4))
223
1.41421356237310
224
sage: n(csc(pi/4),100)
225
1.4142135623730950488016887242
226
sage: csc(1/2)
227
csc(1/2)
228
sage: csc(0.5)
229
2.08582964293349
230
231
sage: latex(csc(x))
232
\csc\left(x\right)
233
234
We can prevent evaluation using the ``hold`` parameter::
235
236
sage: csc(pi/4,hold=True)
237
csc(1/4*pi)
238
239
To then evaluate again, we currently must use Maxima via
240
:meth:`sage.symbolic.expression.Expression.simplify`::
241
242
sage: a = csc(pi/4,hold=True); a.simplify()
243
sqrt(2)
244
245
"""
246
BuiltinFunction.__init__(self, "csc", latex_name=r"\csc")
247
248
def _evalf_(self, x, parent=None):
249
"""
250
EXAMPLES::
251
252
sage: n(csc(pi/4),100)
253
1.4142135623730950488016887242
254
sage: float(csc(pi/4))
255
1.4142135623730951
256
"""
257
if parent is float:
258
return 1/math.sin(x)
259
return (1 / x.sin())
260
261
def _eval_numpy_(self, x):
262
"""
263
EXAMPLES::
264
265
sage: import numpy
266
sage: a = numpy.arange(2, 5)
267
sage: csc(a)
268
array([ 1.09975017, 7.0861674 , -1.32134871])
269
"""
270
return 1 / sin(x)
271
272
273
def _eval_(self, x):
274
"""
275
EXAMPLES::
276
277
sage: csc(pi/4)
278
sqrt(2)
279
sage: csc(x).subs(x==pi/4)
280
sqrt(2)
281
sage: csc(pi/7)
282
csc(1/7*pi)
283
sage: csc(x)
284
csc(x)
285
"""
286
sin_x = sin(x)
287
if is_Expression(sin_x) and sin_x.operator() is sin:
288
return None
289
else:
290
return 1/sin_x
291
292
def _derivative_(self, x, diff_param=None):
293
"""
294
EXAMPLES::
295
296
sage: bool(diff(csc(x), x) == diff(1/sin(x), x))
297
True
298
sage: diff(csc(x), x)
299
-csc(x)*cot(x)
300
"""
301
return -csc(x)*cot(x)
302
303
csc = Function_csc()
304
305
class Function_cot(BuiltinFunction):
306
def __init__(self):
307
"""
308
The cotangent function.
309
310
EXAMPLES::
311
312
sage: cot(pi/4)
313
1
314
sage: RR(cot(pi/4))
315
1.00000000000000
316
sage: cot(1/2)
317
cot(1/2)
318
sage: cot(0.5)
319
1.83048772171245
320
321
sage: latex(cot(x))
322
\cot\left(x\right)
323
324
We can prevent evaluation using the ``hold`` parameter::
325
326
sage: cot(pi/4,hold=True)
327
cot(1/4*pi)
328
329
To then evaluate again, we currently must use Maxima via
330
:meth:`sage.symbolic.expression.Expression.simplify`::
331
332
sage: a = cot(pi/4,hold=True); a.simplify()
333
1
334
335
"""
336
BuiltinFunction.__init__(self, "cot", latex_name=r"\cot")
337
338
def _eval_(self, x):
339
"""
340
EXAMPLES::
341
342
sage: cot(pi/4)
343
1
344
sage: cot(x).subs(x==pi/4)
345
1
346
sage: cot(pi/7)
347
cot(1/7*pi)
348
sage: cot(x)
349
cot(x)
350
"""
351
tan_x = tan(x)
352
if is_Expression(tan_x) and tan_x.operator() is tan:
353
return None
354
else:
355
return 1/tan_x
356
357
def _eval_numpy_(self, x):
358
"""
359
EXAMPLES::
360
361
sage: import numpy
362
sage: a = numpy.arange(2, 5)
363
sage: cot(a)
364
array([-0.45765755, -7.01525255, 0.86369115])
365
"""
366
return 1 / tan(x)
367
368
def _evalf_(self, x, parent=None):
369
"""
370
EXAMPLES::
371
372
sage: n(cot(pi/4),100)
373
1.0000000000000000000000000000
374
sage: float(cot(1))
375
0.64209261593433...
376
"""
377
if parent is float:
378
return 1/math.tan(x)
379
return x.cot()
380
381
def _derivative_(self, x, diff_param=None):
382
"""
383
EXAMPLES::
384
385
sage: bool(diff(cot(x), x) == diff(1/tan(x), x))
386
True
387
sage: diff(cot(x), x)
388
-csc(x)^2
389
"""
390
return -csc(x)**2
391
392
cot = Function_cot()
393
394
395
###################################
396
# Inverse Trigonometric Functions #
397
###################################
398
399
class Function_arcsin(GinacFunction):
400
def __init__(self):
401
"""
402
The arcsine function.
403
404
EXAMPLES::
405
406
sage: arcsin(0.5)
407
0.523598775598299
408
sage: arcsin(1/2)
409
1/6*pi
410
sage: arcsin(1 + 1.0*I)
411
0.666239432492515 + 1.06127506190504*I
412
413
We can delay evaluation using the ``hold`` parameter::
414
415
sage: arcsin(0,hold=True)
416
arcsin(0)
417
418
To then evaluate again, we currently must use Maxima via
419
:meth:`sage.symbolic.expression.Expression.simplify`::
420
421
sage: a = arcsin(0,hold=True); a.simplify()
422
0
423
424
``conjugate(arcsin(x))==arcsin(conjugate(x))`` unless on the branch
425
cuts which run along the real axis outside the interval [-1, +1].::
426
427
sage: conjugate(arcsin(x))
428
conjugate(arcsin(x))
429
sage: var('y', domain='positive')
430
y
431
sage: conjugate(arcsin(y))
432
conjugate(arcsin(y))
433
sage: conjugate(arcsin(y+I))
434
conjugate(arcsin(y + I))
435
sage: conjugate(arcsin(1/16))
436
arcsin(1/16)
437
sage: conjugate(arcsin(2))
438
conjugate(arcsin(2))
439
sage: conjugate(arcsin(-2))
440
-conjugate(arcsin(2))
441
442
TESTS::
443
444
sage: arcsin(x).operator()
445
arcsin
446
"""
447
GinacFunction.__init__(self, 'arcsin', latex_name=r"\arcsin",
448
conversions=dict(maxima='asin', sympy='asin'))
449
450
arcsin = asin = Function_arcsin()
451
452
class Function_arccos(GinacFunction):
453
def __init__(self):
454
"""
455
The arccosine function
456
457
EXAMPLES::
458
459
sage: arccos(0.5)
460
1.04719755119660
461
sage: arccos(1/2)
462
1/3*pi
463
sage: arccos(1 + 1.0*I)
464
0.904556894302381 - 1.06127506190504*I
465
sage: arccos(3/4).n(100)
466
0.72273424781341561117837735264
467
468
We can delay evaluation using the ``hold`` parameter::
469
470
sage: arccos(0,hold=True)
471
arccos(0)
472
473
To then evaluate again, we currently must use Maxima via
474
:meth:`sage.symbolic.expression.Expression.simplify`::
475
476
sage: a = arccos(0,hold=True); a.simplify()
477
1/2*pi
478
479
``conjugate(arccos(x))==arccos(conjugate(x))`` unless on the branch
480
cuts which run along the real axis outside the interval [-1, +1].::
481
482
sage: conjugate(arccos(x))
483
conjugate(arccos(x))
484
sage: var('y', domain='positive')
485
y
486
sage: conjugate(arccos(y))
487
conjugate(arccos(y))
488
sage: conjugate(arccos(y+I))
489
conjugate(arccos(y + I))
490
sage: conjugate(arccos(1/16))
491
arccos(1/16)
492
sage: conjugate(arccos(2))
493
conjugate(arccos(2))
494
sage: conjugate(arccos(-2))
495
pi - conjugate(arccos(2))
496
497
TESTS::
498
499
sage: arccos(x).operator()
500
arccos
501
"""
502
GinacFunction.__init__(self, 'arccos', latex_name=r"\arccos",
503
conversions=dict(maxima='acos', sympy='acos'))
504
505
arccos = acos = Function_arccos()
506
507
class Function_arctan(GinacFunction):
508
def __init__(self):
509
"""
510
The arctangent function.
511
512
EXAMPLES::
513
514
sage: arctan(1/2)
515
arctan(1/2)
516
sage: RDF(arctan(1/2))
517
0.463647609001
518
sage: arctan(1 + I)
519
arctan(I + 1)
520
sage: arctan(1/2).n(100)
521
0.46364760900080611621425623146
522
523
We can delay evaluation using the ``hold`` parameter::
524
525
sage: arctan(0,hold=True)
526
arctan(0)
527
528
To then evaluate again, we currently must use Maxima via
529
:meth:`sage.symbolic.expression.Expression.simplify`::
530
531
sage: a = arctan(0,hold=True); a.simplify()
532
0
533
534
``conjugate(arctan(x))==arctan(conjugate(x))`` unless on the branch
535
cuts which run along the imaginary axis outside the interval [-I, +I].::
536
537
sage: conjugate(arctan(x))
538
conjugate(arctan(x))
539
sage: var('y', domain='positive')
540
y
541
sage: conjugate(arctan(y))
542
arctan(y)
543
sage: conjugate(arctan(y+I))
544
conjugate(arctan(y + I))
545
sage: conjugate(arctan(1/16))
546
arctan(1/16)
547
sage: conjugate(arctan(-2*I))
548
conjugate(arctan(-2*I))
549
sage: conjugate(arctan(2*I))
550
conjugate(arctan(2*I))
551
sage: conjugate(arctan(I/2))
552
arctan(-1/2*I)
553
554
TESTS::
555
556
sage: arctan(x).operator()
557
arctan
558
"""
559
GinacFunction.__init__(self, "arctan", latex_name=r'\arctan',
560
conversions=dict(maxima='atan', sympy='atan'))
561
562
arctan = atan = Function_arctan()
563
564
class Function_arccot(BuiltinFunction):
565
def __init__(self):
566
"""
567
The arccotangent function.
568
569
EXAMPLES::
570
571
sage: arccot(1/2)
572
arccot(1/2)
573
sage: RDF(arccot(1/2))
574
1.10714871779
575
sage: arccot(1 + I)
576
arccot(I + 1)
577
578
We can delay evaluation using the ``hold`` parameter::
579
580
sage: arccot(1,hold=True)
581
arccot(1)
582
583
To then evaluate again, we currently must use Maxima via
584
:meth:`sage.symbolic.expression.Expression.simplify`::
585
586
sage: a = arccot(1,hold=True); a.simplify()
587
1/4*pi
588
589
"""
590
BuiltinFunction.__init__(self, "arccot", latex_name=r'{\rm arccot}',
591
conversions=dict(maxima='acot', sympy='acot'))
592
593
def _evalf_(self, x, parent=None):
594
"""
595
EXAMPLES::
596
597
sage: arccot(1/2).n(100)
598
1.1071487177940905030170654602
599
sage: float(arccot(1/2))
600
1.1071487177940904
601
"""
602
if parent is float:
603
return math.pi/2 - math.atan(x)
604
from sage.symbolic.constants import pi
605
return parent(pi/2 - x.arctan())
606
607
def _eval_numpy_(self, x):
608
"""
609
EXAMPLES::
610
611
sage: import numpy
612
sage: a = numpy.arange(2, 5)
613
sage: arccot(a)
614
array([ 0.46364761, 0.32175055, 0.24497866])
615
"""
616
return math.pi/2 - arctan(x)
617
618
def _derivative_(self, *args, **kwds):
619
"""
620
EXAMPLES::
621
622
sage: bool(diff(acot(x), x) == -diff(atan(x), x))
623
True
624
sage: diff(acot(x), x)
625
-1/(x^2 + 1)
626
"""
627
x = args[0]
628
return -1/(x**2 + 1)
629
630
arccot = acot = Function_arccot()
631
632
class Function_arccsc(BuiltinFunction):
633
def __init__(self):
634
"""
635
The arccosecant function.
636
637
EXAMPLES::
638
639
sage: arccsc(2)
640
arccsc(2)
641
sage: RDF(arccsc(2))
642
0.523598775598
643
sage: arccsc(1 + I)
644
arccsc(I + 1)
645
646
We can delay evaluation using the ``hold`` parameter::
647
648
sage: arccsc(1,hold=True)
649
arccsc(1)
650
651
To then evaluate again, we currently must use Maxima via
652
:meth:`sage.symbolic.expression.Expression.simplify`::
653
654
sage: a = arccsc(1,hold=True); a.simplify()
655
1/2*pi
656
657
"""
658
BuiltinFunction.__init__(self, "arccsc", latex_name=r'{\rm arccsc}',
659
conversions=dict(maxima='acsc'))
660
661
def _evalf_(self, x, parent=None):
662
"""
663
EXAMPLES::
664
665
sage: arccsc(2).n(100)
666
0.52359877559829887307710723055
667
sage: float(arccsc(2))
668
0.52359877559829...
669
"""
670
if parent is float:
671
return math.asin(1/x)
672
return (1/x).arcsin()
673
674
def _eval_numpy_(self, x):
675
"""
676
EXAMPLES::
677
678
sage: import numpy
679
sage: a = numpy.arange(2, 5)
680
sage: arccsc(a)
681
array([ 0.52359878, 0.33983691, 0.25268026])
682
"""
683
return arcsin(1.0/x)
684
685
def _derivative_(self, x, diff_param=None):
686
"""
687
EXAMPLES::
688
689
sage: diff(acsc(x), x)
690
-1/(sqrt(-1/x^2 + 1)*x^2)
691
"""
692
return -1/(x**2 * (1 - x**(-2)).sqrt())
693
694
arccsc = acsc = Function_arccsc()
695
696
class Function_arcsec(BuiltinFunction):
697
def __init__(self):
698
"""
699
The arcsecant function.
700
701
EXAMPLES::
702
703
sage: arcsec(2)
704
arcsec(2)
705
sage: RDF(arcsec(2))
706
1.0471975512
707
sage: arcsec(1 + I)
708
arcsec(I + 1)
709
710
We can delay evaluation using the ``hold`` parameter::
711
712
sage: arcsec(1,hold=True)
713
arcsec(1)
714
715
To then evaluate again, we currently must use Maxima via
716
:meth:`sage.symbolic.expression.Expression.simplify`::
717
718
sage: a = arcsec(1,hold=True); a.simplify()
719
0
720
721
"""
722
BuiltinFunction.__init__(self, "arcsec", latex_name=r'{\rm arcsec}',
723
conversions=dict(maxima='asec'))
724
725
def _evalf_(self, x, parent=None):
726
"""
727
EXAMPLES::
728
729
sage: arcsec(2).n(100)
730
1.0471975511965977461542144611
731
"""
732
if parent is float:
733
return math.acos(1/x)
734
return (1/x).arccos()
735
736
def _eval_numpy_(self, x):
737
"""
738
EXAMPLES::
739
740
sage: import numpy
741
sage: a = numpy.arange(2, 5)
742
sage: arcsec(a)
743
array([ 1.04719755, 1.23095942, 1.31811607])
744
"""
745
return arccos(1.0/x)
746
747
748
def _derivative_(self, x, diff_param=None):
749
"""
750
EXAMPLES::
751
752
sage: diff(asec(x), x)
753
1/(sqrt(-1/x^2 + 1)*x^2)
754
"""
755
return 1/(x**2 * (1 - x**(-2)).sqrt())
756
757
arcsec = asec = Function_arcsec()
758
759
class Function_arctan2(GinacFunction):
760
def __init__(self):
761
"""
762
The modified arctangent function.
763
764
Returns the arc tangent (measured in radians) of `y/x`, where
765
unlike ``arctan(y/x)``, the signs of both ``x`` and ``y`` are
766
considered. In particular, this function measures the angle
767
of a ray through the origin and `(x,y)`, with the positive
768
`x`-axis the zero mark, and with output angle `\theta`
769
being between `-\pi<\theta<=\pi`.
770
771
Hence, ``arctan2(y,x) = arctan(y/x)`` only for `x>0`. One
772
may consider the usual arctan to measure angles of lines
773
through the origin, while the modified function measures
774
rays through the origin.
775
776
Note that the `y`-coordinate is by convention the first input.
777
778
779
EXAMPLES:
780
781
Note the difference between the two functions::
782
783
sage: arctan2(1,-1)
784
3/4*pi
785
sage: arctan(1/-1)
786
-1/4*pi
787
788
This is consistent with Python and Maxima::
789
790
sage: maxima.atan2(1,-1)
791
3*%pi/4
792
sage: math.atan2(1,-1)
793
2.356194490192345
794
795
More examples::
796
797
sage: arctan2(1,0)
798
1/2*pi
799
sage: arctan2(2,3)
800
arctan(2/3)
801
sage: arctan2(-1,-1)
802
-3/4*pi
803
804
Of course we can approximate as well::
805
806
sage: arctan2(-1/2,1).n(100)
807
-0.46364760900080611621425623146
808
sage: arctan2(2,3).n(100)
809
0.58800260354756755124561108063
810
811
We can delay evaluation using the ``hold`` parameter::
812
813
sage: arctan2(-1/2,1,hold=True)
814
arctan2(-1/2, 1)
815
816
To then evaluate again, we currently must use Maxima via
817
:meth:`sage.symbolic.expression.Expression.simplify`::
818
819
sage: arctan2(-1/2,1,hold=True).simplify()
820
-arctan(1/2)
821
822
The function also works with numpy arrays as input::
823
824
sage: import numpy
825
sage: a = numpy.linspace(1, 3, 3)
826
sage: b = numpy.linspace(3, 6, 3)
827
sage: atan2(a, b)
828
array([ 0.32175055, 0.41822433, 0.46364761])
829
830
sage: atan2(1,a)
831
array([ 0.78539816, 0.46364761, 0.32175055])
832
833
sage: atan2(a, 1)
834
array([ 0.78539816, 1.10714872, 1.24904577])
835
836
TESTS::
837
838
sage: x,y = var('x,y')
839
sage: arctan2(y,x).operator()
840
arctan2
841
842
Check if #8565 is fixed::
843
844
sage: atan2(-pi,0)
845
-1/2*pi
846
847
Check if #8564 is fixed::
848
849
sage: arctan2(x,x)._sympy_()
850
atan2(x, x)
851
852
Check if numerical evaluation works #9913::
853
854
sage: arctan2(0, -log(2)).n()
855
3.14159265358979
856
857
Check if atan2(0,0) throws error of :trac:`11423`::
858
859
sage: atan2(0,0)
860
Traceback (most recent call last):
861
...
862
RuntimeError: arctan2_eval(): arctan2(0,0) encountered
863
864
sage: atan2(0,0,hold=True)
865
arctan2(0, 0)
866
867
sage: atan2(0,0,hold=True).n()
868
Traceback (most recent call last):
869
...
870
ValueError: arctan2(0,0) undefined
871
872
"""
873
GinacFunction.__init__(self, "arctan2", nargs=2, latex_name=r'\arctan',
874
conversions=dict(maxima='atan2', sympy='atan2'))
875
876
arctan2 = atan2 = Function_arctan2()
877
878