【发布时间】:2016-02-20 17:56:42
【问题描述】:
我正在尝试使用库:https://github.com/hiddentao/linear-algebra
要使用的文档状态:
Include dist/linear-algebra.js script into your HTML.
In the browser the library is exposed via the linearAlgebra() function.
但是使用代码:
<script src="linear-algebra.js"></script>
<!-- https://github.com/hiddentao/linear-algebra
-->
<script>
var m = new linearAlgebra().Matrix([ [1, 2, 3], [4, 5, 6] ]);
console.log( m.rows ); // 2
console.log( m.cols ); // 3
console.log( m.data ); // [ [1, 2, 3], [4, 5, 6] ]
</script>
导致 Chrome 错误:
Uncaught TypeError: Cannot read property 'rows' of undefined
我没有以正确的方式使用该库,应该可以使用linearAlgebra() ref 吗?
感谢任何其他推荐的 js 数学库。
【问题讨论】: