1 | 'use strict';
|
2 |
|
3 | function factory(type, config, load, typed) {
|
4 | var matrix = load(require('../../type/matrix/function/matrix'));
|
5 |
|
6 | var algorithm02 = load(require('../../type/matrix/utils/algorithm02'));
|
7 | var algorithm03 = load(require('../../type/matrix/utils/algorithm03'));
|
8 | var algorithm09 = load(require('../../type/matrix/utils/algorithm09'));
|
9 | var algorithm11 = load(require('../../type/matrix/utils/algorithm11'));
|
10 | var algorithm12 = load(require('../../type/matrix/utils/algorithm12'));
|
11 | var algorithm13 = load(require('../../type/matrix/utils/algorithm13'));
|
12 | var algorithm14 = load(require('../../type/matrix/utils/algorithm14'));
|
13 |
|
14 | |
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 | var atan2 = typed('atan2', {
|
44 |
|
45 | 'number, number': Math.atan2,
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 | 'BigNumber, BigNumber': function BigNumberBigNumber(y, x) {
|
52 | return type.BigNumber.atan2(y, x);
|
53 | },
|
54 |
|
55 | 'SparseMatrix, SparseMatrix': function SparseMatrixSparseMatrix(x, y) {
|
56 | return algorithm09(x, y, atan2, false);
|
57 | },
|
58 |
|
59 | 'SparseMatrix, DenseMatrix': function SparseMatrixDenseMatrix(x, y) {
|
60 |
|
61 | return algorithm02(y, x, atan2, true);
|
62 | },
|
63 |
|
64 | 'DenseMatrix, SparseMatrix': function DenseMatrixSparseMatrix(x, y) {
|
65 | return algorithm03(x, y, atan2, false);
|
66 | },
|
67 |
|
68 | 'DenseMatrix, DenseMatrix': function DenseMatrixDenseMatrix(x, y) {
|
69 | return algorithm13(x, y, atan2);
|
70 | },
|
71 |
|
72 | 'Array, Array': function ArrayArray(x, y) {
|
73 | return atan2(matrix(x), matrix(y)).valueOf();
|
74 | },
|
75 |
|
76 | 'Array, Matrix': function ArrayMatrix(x, y) {
|
77 | return atan2(matrix(x), y);
|
78 | },
|
79 |
|
80 | 'Matrix, Array': function MatrixArray(x, y) {
|
81 | return atan2(x, matrix(y));
|
82 | },
|
83 |
|
84 | 'SparseMatrix, number | BigNumber': function SparseMatrixNumberBigNumber(x, y) {
|
85 | return algorithm11(x, y, atan2, false);
|
86 | },
|
87 |
|
88 | 'DenseMatrix, number | BigNumber': function DenseMatrixNumberBigNumber(x, y) {
|
89 | return algorithm14(x, y, atan2, false);
|
90 | },
|
91 |
|
92 | 'number | BigNumber, SparseMatrix': function numberBigNumberSparseMatrix(x, y) {
|
93 |
|
94 | return algorithm12(y, x, atan2, true);
|
95 | },
|
96 |
|
97 | 'number | BigNumber, DenseMatrix': function numberBigNumberDenseMatrix(x, y) {
|
98 |
|
99 | return algorithm14(y, x, atan2, true);
|
100 | },
|
101 |
|
102 | 'Array, number | BigNumber': function ArrayNumberBigNumber(x, y) {
|
103 | return algorithm14(matrix(x), y, atan2, false).valueOf();
|
104 | },
|
105 |
|
106 | 'number | BigNumber, Array': function numberBigNumberArray(x, y) {
|
107 | return algorithm14(matrix(y), x, atan2, true).valueOf();
|
108 | }
|
109 | });
|
110 |
|
111 | atan2.toTex = { 2: '\\mathrm{atan2}\\left(${args}\\right)' };
|
112 |
|
113 | return atan2;
|
114 | }
|
115 |
|
116 | exports.name = 'atan2';
|
117 | exports.factory = factory; |
\ | No newline at end of file |