12

What is the best way to solve sets of linear equations using JavaScript?

I would like to find a solution for vector r

M*r = b

where M is a Matrix and b is a vector.

I understand that JavaScript isn't the best computational language, i'm simply hoping to implement my algorithm in JS for rapid prototyping.

Any references to other questions or help would be awesome! thanks in advance.

Aaron
  • 2,450
  • 1
  • 17
  • 23
  • See here for some available tools: http://stackoverflow.com/questions/2753489/javascript-computer-algebra-system – Anderson Green Mar 07 '14 at 20:48
  • Also here for linear algebra libraries in javascript: http://stackoverflow.com/questions/4286837/linear-algebra-library-for-javascript – R. Barzell Mar 07 '14 at 20:48
  • "I'm pretty amazed this didn't come up in my pre-ask search" that's because it's not an appropriate question for [SO], and [your question should be closed as off-topic](http://meta.stackexchange.com/q/139399/153542). – zzzzBov Mar 07 '14 at 23:56
  • @zzBov I think I understand the issue. I rephrased the question... is this better? thanks – Aaron Mar 10 '14 at 20:20
  • 3
    @zzBov can you please re-look at this question and re-open it? – Aaron Sep 22 '14 at 20:22
  • 3
    For future googlers: Using [algebra.js](http://algebra.js.org/) and combining `Equation.solveFor()` and `Equation.eval()`, you can solve a system of equations with the substitution method. An example with two equations: https://jsfiddle.net/38wpbteu/ – Sphinxxx Mar 02 '17 at 17:40
  • 2
    Unbelievable that this was closed, there is nothing wrong with the question. It's completely appropriate. – trujello Sep 20 '21 at 21:28

0 Answers0