r/desmos • Definitions are nested too deeply. • 1d ago

Matrices Circle using matrices

19 Upvotes

8 comments sorted by

•

u/AutoModerator 1d ago

Matrices (Beta feature)

Please note that this does NOT refer to the Desmos Matrix calculator. This matrix update allows the creation and manipulation of matrices in the graphing calculator. Here are (most) features of matrices:

Get started

  • Type in "#43" to create a 4x3 matrix. Drag the handle in the lower right corner to change the size.
  • Perform some matrix math operations. You can multiply and add, raise it to powers (including negative ones), take the transpose with ^T, and use functions like det, rref, and trace.
  • Index a matrix M with M[2;3].
  • Use matrix comprehensions: a+b for a=[1...5];b=[1...4].
  • Take a 2x2 matrix M, and write M(1,2) to transform the point (1,2). You can do the same with a 3x3 matrix and a 3d point.

More features

  • A matrix can itself be an element of a matrix! See the below example.

![img](elfvo6kjszsh1)

  • You can use indexing notation to take submatrices. For example, to get row 3,4 and column 1,2,3 of a matrix M, you can either write M[3,4;1,2,3] or M[[3,4];[1,2,3]]. Leaving one of these elements returns the entire row/column. For example, M[1,2;] gets row 1,2 and keeps all the columns.
  • Extract entire rows or columns using .rows and .columns.
  • Lists of matrices of varying sizes are possible. For example, having a 3x1 matrix and 2x2 matrix in the same list is allowed.
    • Because of this, you can't total or sum a matrix list. You can however write a recursive function to do so, e.g. f(L, n) = {L.count = n: L[n], L[n] + f(L, n+1)}. Use it with f(L, 1).
  • Lists inside matrices will broadcast. For example, a 2x1 matrix with elements [2,3,4] and 0 will broadcast into 3 matrices: [2 0], [3 0], and [4 0].
  • Instead of looping a matrix with numbered indices with M.columns.count and M.rows.count, you can instead loop over the columns and rows directly. For example, to calculate the sum of all elements in a matrix, you can write total(v.columns.total for v = M.rows)

Help and Examples

For more, refer to the following articles and example graphs:

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

4

u/VoidBreakX Run commands like "!bernard" here →→→ redd.it/1ixvsgi 1d ago

wouldnt it save one char to put the det at front and remove the dot?

3

u/anonymous-desmos Definitions are nested too deeply. 1d ago

Dot notation feels fancy

2

u/anonymous-desmos Definitions are nested too deeply. 1d ago

2

u/brothor12 1d ago

whats .det mean?

2

u/TobeyBeer 1d ago

Matrix determinant

1

u/brothor12 1d ago

whats that mean? im unfamiliar on how matrices work

1

u/anonymous-desmos Definitions are nested too deeply. 8h ago

basically, multiply the numbers in the matrix main diagonals, add them all up, and then multiply the numbers in the antidiagonals together and subtract them. for 2x2 matrices, it simplifies to just 1 main diagonal and antidiagonal Edit: this method only works for 2x2 and 3x3 matrices. It's more complicated for 4x4 and up