You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2019. It is now read-only.
Was about to start writing some features for vectors and after looking at some of the code, thought that Vectors should operate on array of expressions as their data type:
For instance,
var Vector = function(args){
this.vec = [];
if (Array.isArray(args)){
args.forEach(function (arg){
var exp = new Expression(arg);
this.vec.push(exp);
});
} else if(typeof(args) !== "undefined"){
throw "Expected array of stirngs";
}
};
Vector.prototype.add = function(args){
var otherVec = args;
if (!(args instanceof Vector)){
otherVec = new Vector(args);
}
if (this.vec.length !== otherVec.vec.length) {
throw "Unequal lengths";
}
var thisVec = this.copy();
var resultVec = new Vector();
for (var i = 0; i<thisVec.length; i++){
var addedExp = thisVec.vec[i].add(otherVec.vec[i]);
resultVec.push(addedExp);
}
return resultVec;
};
Following this logic, nd-vectors or Martrices would operate on the same logic, keeping an array of vectors as their internal data structure.
Any suggestions?
The text was updated successfully, but these errors were encountered:
Actually, you can go ahead and write the feature for this. I have been busy with some other stuff.
I am actually gonna go ahead and add plotting feature for all fractions, equations and expressions.
To add to that, I had a few framework adjustment ideas to suggest if you wanna talk this in detail. We can definitely open a Gitter Chat for this if you like
Was about to start writing some features for vectors and after looking at some of the code, thought that Vectors should operate on array of expressions as their data type:
For instance,
Following this logic, nd-vectors or Martrices would operate on the same logic, keeping an array of vectors as their internal data structure.
Any suggestions?
The text was updated successfully, but these errors were encountered: