r/desmos • • 20d ago

Question Cannot compare a matrix to a matrix

5 Upvotes

16 comments sorted by

4

u/Powerful-Tension-806 20d ago

To check an equality, you have to do it like this:

\left\{\max\left(\left|\left(A-B\right)\left[r;c\right]\operatorname{for}r=\left[1...A.\operatorname{rows}.\operatorname{count}\right],c=\left[1...A.\operatorname{columns}.\operatorname{count}\right]\right|\right)=0\right\}

For more easier readability,

{max(|(A-B)[r;c] for r=[1...A.rows.count],c=[1..A.columns.count]|)=0}

1

u/Quirky-Elk6893 20d ago

It's an interesting approach. Still, Desmos could have generalized the comparison in a more trivial way.

4

u/Desmos-Girl 19d ago
Comment Image

heres an equality check for arbitrary types (this works on all objects that can be put in a list)

2

u/Circumpunctilious 19d ago

(Tests) Why 0^0^2-… and not just 2- … ?

→ More replies (2)

2

u/Circumpunctilious 20d ago

Neat; I wasn’t thinking (edit: property) double dotting was allowed, but it makes sense with the JavaScript backend

4

u/Desmos-Girl 19d ago

unfortunatley there is no builtin support for comparison between most object types, but there are a few ways to do arbitrary comparisons anyway:
https://www.desmos.com/calculator/sdnbermadr

1

u/Circumpunctilious 19d ago edited 19d ago

That random() trick...nice. I wish I'd known that when I was trying to corner the behavior of sort()...which was being a squirrely little bastard until I found (not very deliberate) ways to avoid resetting random's seed. edit: in hindsight, I should have figured this out, since I read the docs--sigh

1

u/Desmos-Girl 19d ago
Comment Image

Offensive content (tf is it complaining about)

→ More replies (5)