mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
atan2 updates
This commit is contained in:
parent
fa24a92b24
commit
586b93bcf3
@ -10,6 +10,7 @@ function factory (type, config, load, typed) {
|
||||
var algorithm03 = load(require('../../type/matrix/util/algorithm03'));
|
||||
var algorithm09 = load(require('../../type/matrix/util/algorithm09'));
|
||||
var algorithm11 = load(require('../../type/matrix/util/algorithm11'));
|
||||
var algorithm12 = load(require('../../type/matrix/util/algorithm12'));
|
||||
var algorithm13 = load(require('../../type/matrix/util/algorithm13'));
|
||||
var algorithm14 = load(require('../../type/matrix/util/algorithm14'));
|
||||
|
||||
@ -122,7 +123,7 @@ function factory (type, config, load, typed) {
|
||||
// check storage format
|
||||
switch (y.storage()) {
|
||||
case 'sparse':
|
||||
c = algorithm11(y, x, atan2, true);
|
||||
c = algorithm12(y, x, atan2, true);
|
||||
break;
|
||||
default:
|
||||
c = algorithm14(y, x, atan2, true);
|
||||
|
||||
@ -130,7 +130,7 @@ describe('atan2', function() {
|
||||
describe('SparseMatrix', function () {
|
||||
|
||||
it('should calculate atan2 sparse matrix - scalar', function () {
|
||||
assert.deepEqual(divide(atan2(1, sparse([[1, -1], [0, 1]])), pi), sparse([[0.25, 0.75], [0.5, 0.25]]));
|
||||
assert.deepEqual(divide(atan2(1, sparse([[1, -1], [0, 1]])), pi), matrix([[0.25, 0.75], [0.5, 0.25]]));
|
||||
assert.deepEqual(divide(atan2(sparse([[1, -1], [0, 1]]), 1), pi), sparse([[0.25, -0.25], [0, 0.25]]));
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user