Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Matrix Operations with Math.js (robinwieruch.de)
57 points by slow_typist on Oct 5, 2023 | hide | past | favorite | 7 comments


I have never heard of matrix division. What is it?


Yeah me too. I'm about to ask this exact question after reading the post. I only know matrix add, subtract, and multiply.


It's to multiply a matrix by the inverse of another. There's left and right division depending on which side is inverted

There are many more matrix operations that actually exist: matrix exponential, matrix log, matrix trig functions, matrix square root, ...

E.g. exponential has an infinite series representation exp(x) = SUM_k x^k / k!: it works for matrices too, and is used



May be matrix inverse?

y = Mx

—>

x = M\y


Nice write-up. If you require additional performance, use ndarray or GPU.js (or try out taichi.js if WebGPU is available).

Hamsters.js can also provide speedups, given you can translate your problem into a 'threaded' task.


I often wish the Matrix protocol was named differently.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: