diff --git a/packages/math/matrix.js b/packages/math/matrix.js index b0489bf..c38ff1c 100644 --- a/packages/math/matrix.js +++ b/packages/math/matrix.js @@ -4,9 +4,9 @@ // matrix is implemented as an n-element array. Data is stored in row-major // order. -export copy = (matrix) => matrix.map((row) => [...row]) +export const copy = (matrix) => matrix.map((row) => [...row]) -export equals = (l, r) -> +export const equals = (l, r) => return false unless l.length is r.length return true if l.length is 0 @@ -20,12 +20,12 @@ export equals = (l, r) -> return true -export size = (matrix) -> +export const size = (matrix) => return 0 if 0 is matrix.length return matrix.length * matrix[0].length -export sizeVector = (matrix) -> +export const sizeVector = (matrix) => return [0, 0] if 0 is matrix.length return [matrix[0].length, matrix.length]