From e7d01869434de72e6444bced2f182b11a0fea146 Mon Sep 17 00:00:00 2001 From: Smilebags Date: Mon, 16 Jan 2017 10:02:40 +1100 Subject: [PATCH] Add nArray --- libraries/p5.dimensions.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/p5.dimensions.js b/libraries/p5.dimensions.js index 142408a..b173adf 100644 --- a/libraries/p5.dimensions.js +++ b/libraries/p5.dimensions.js @@ -110,6 +110,14 @@ p5.prototype.nLimit = function(v1, n){ return output; } +p5.prototype.nArray = function(v1){ + var output = []; + for (var i = 0; i < Object.keys(v1).length; i++){ + output[i] = v1[dimensionalSymbols[i]]; + } + return output; +} + p5.prototype.nAdd = function(v1,v2) { //implement add of nVectors var output = new nVector();