Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Fix diff for matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
jiggzson committed Mar 22, 2020
1 parent 38e80f7 commit 5e49cdc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Calculus.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,17 @@ if((typeof module) !== 'undefined' && typeof nerdamer === 'undefined') {
if(core.Utils.isVector(symbol)) {
var vector = new core.Vector([]);
symbol.each(function(x) {
vector.elements.push(__.diff(x, wrt));
vector.elements.push(__.diff(x, wrt, nth));
});
return vector;
}
else if(core.Utils.isMatrix(symbol)) {
var matrix = new core.Matrix();
symbol.each(function(x, j, i) {
matrix.set(i, j, __.diff(x, wrt, nth));
});
return matrix;
}

var d = isSymbol(wrt) ? wrt.text() : wrt;
//the nth derivative
Expand Down
2 changes: 1 addition & 1 deletion all.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ require('./Solve.js');
require('./Extra.js');

//export nerdamer
module.exports = nerdamer;
module.exports = nerdamer;

0 comments on commit 5e49cdc

Please sign in to comment.