This is pretty cool. I've been using CoffeeScript to post-process MD simulation results because it's such an easy language to get things done in. Tools like this will make it even easier. Although, could someone clarify for me the floating point issues mentioned by Steve? I wasn't aware there were issues...
Show HN: Advanced Mathematics Library for Node.js and JavaScript
41–49 of 49 posts
Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript
#42Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript
#43A couple of observations:
1. You should probably go ahead and implement at least LU decomposition, QR factorization, and maybe some eigenvalue/eigenvector stuff if you want to claim "advanced".
2. You should use the recursive definition of the determinant in the >3x3 matrix case.
3. You should consider adding some vector methods of the form: ax+by (for scalar a & b, and vector x & y). This can be useful for doing linear interpolation and whatnot.
4. You should add cross products/outer products for vectors.
5. You should have a mechanism for generating a Gaussian or normal distribution, or at least supply some standard mappings from your (presumably uniform) random function to something more useful (Gaussian, Possoin, Weibull, whatever).
6. An FFT would be nice. :)
7. Quaternions would also be handy for graphics folks, or motion folks.
8. Complex number support would be cool.
9. Support for optimization, like integer programming, linear programming, or even least-squares or whatever would be nice.
~
Again, great work--I look forward to seeing how this project evolves!
Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript
#44First of all, good work! A couple of observations: 1. You should probably go ahead and implement at least LU decomposition, QR factorization, and maybe some eigenvalue/eigenvector stuff if you want to claim "advanced". 2. You should use the recursive definition of the determinant in the >3x3 matrix case. 3. You should consider adding some vector methods of the form: ax+by (for scalar a & b, and vector x & y). This ca…
Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript
#45 -should support FFT/convolution
-could tie into http://sylvester.jcoglan.com/ for
vector/matrix stuff (excellent library!)
-I emailed jcoglan about the possibility of adding
complex number support to Sylvester, he encouraged me
to try but thought it might introduce too much function
call overhead (caching function results might help a
bit?)
-I didn't get to look at it too closely, but
https://github.com/jtobey/javascript-bignum looks
interesting, as does https://github.com/pr1001/MathPlus
-polynomial fit (least squares regression) and
interpolation stuff is in high demand
-it should be super easy to integrate output with d3.js
(like the equivalent of MATLAB plot function)
Honestly, I doubt I would have been able to pull it off, but I intend to contribute to this project as much as I can.EDIT: Formatting
Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript
#46This is awesome ! I started thinking about doing something similar a few months ago, but the project I needed it for kind of fell through and I moved on. Anyway, a few thoughts I had at the time: -should support FFT/convolution -could tie into http://sylvester.jcoglan.com/ for vector/matrix stuff (excellent library!) -I emailed jcoglan about the possibility of adding complex number support to Sylvester, he encouraged…
Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript
#47First of all, good work! A couple of observations: 1. You should probably go ahead and implement at least LU decomposition, QR factorization, and maybe some eigenvalue/eigenvector stuff if you want to claim "advanced". 2. You should use the recursive definition of the determinant in the >3x3 matrix case. 3. You should consider adding some vector methods of the form: ax+by (for scalar a & b, and vector x & y). This ca…
This is a fantastic list. There are a few people who've expressed interest in working on eigenvalue work. I'll definitely be adding a couple of these in, in the next few days. I'll keep you posted.
Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript
#48Earlier quoted context omitted.
That's why you don't compare floating point numbers with the = operator. You use something like: fabs( a-b ) where epsilon is usually defined by the language as a very small quantity (example values in C are 1E-8 for a float, 1E-15 for double), or you can just use a hard coded value appropriate to the values you are comparing.
That "where epsilon is usually defined by the language as a very small quantity" is BAD advice. double.epsilon and float.epsilon (std::numeric_limits::epsilon in C++) are "machine epsilons": numbers equal to the difference between 1 and the next representable value. In other words: 1 and 1+epsilon can be represented exactly, but there are no representable numbers between the two. The distance between representable nu…
Re: Show HN: Advanced Mathematics Library for Node.js and JavaScript
#49First of all, good work! A couple of observations: 1. You should probably go ahead and implement at least LU decomposition, QR factorization, and maybe some eigenvalue/eigenvector stuff if you want to claim "advanced". 2. You should use the recursive definition of the determinant in the >3x3 matrix case. 3. You should consider adding some vector methods of the form: ax+by (for scalar a & b, and vector x & y). This ca…