Mathematica - Determinant
Posted on April 4, 2021
Tags: mathematica
""] := {Inset[Style[label,Purple],Midpoint[{p,q}]], Arrow[{p,q}]};
AArrow[{p_, q_}, label_:= Graphics@AArrow[{ConstantArray[0,Length[p]],p}];
vec2[p_] := Which[ ArrayQ[q] == False, Graphics@AArrow[{ConstantArray[0,Length[p]],p},q],
vec2[p_,q_] :== True, Graphics@AArrow[{p,q},""] ]
ArrayQ[q] = Graphics@AArrow[{p,q},label];
vec2[p_,q_,label_] :
= Which[ Length[p] == 2, vec2[p],
vec[p_] :== 3, vec2[p] /. Graphics -> Graphics3D ];
Length[p] = Which[ Length[p] == 2, vec2[p,q],
vec[p_,q_] :== 3, vec2[p,q] /. Graphics -> Graphics3D ];
Length[p] = Which[ Length[p] == 2,vec2[p,q,label],
vec[p_,q_,label_] :== 3,vec2[p,q,label] /. Graphics -> Graphics3D];
Length[q] = (# /. Arrow[x__] -> {c, Arrow[x]})&
sty[c__:Red] :* sty[Red]@vec[{3,5}]*)
(
= expr /. List[p__]-> MatrixForm[List[p]]
matrix[expr_] := TeXForm[Row[{x}]];
cout[x__] := Graphics3D@Point[x];
pnt[x_] :
* polynomial *)
(* helper functions *)
(vars[n_, m_] := Flatten@Transpose[Outer[Symbol@StringJoin[##] &, CharacterRange["A", "Z"][[;; m]], ToString /@ Range[n]]]
= Flatten[{1,vars[v-1,1]}];
polyvar[v_] :
* Give a list of coefficents and it will generate a polynomial with variables *)
(= Transpose[coef].polyvar[Length@coef];
poly[coef_] :@Thread[{{1,2,3}}];
poly
= Transpose;
T := Dimensions;
Dim = ConstantArray[1,n]
Ones[n_] := MapThread[Append, {#, x}] &
addCol[x_] :* addCol[ConstantArray[1,2]]@{{1,3},{3,4}} // matrix*)
(= Append[#,x]& addRow[x_] :
- Determinant of 1 = means energy is conserved = area is conserved
- Determinant of -1 = means energy is inverted
- Determinant of trivial matrix = \(\Pi\)MainDiagonal - \(\Pi\)MinDiagonal
= {0,1};
basisX = {1,0};
basisY = {{0,1},{1,0}};
rotation = {{Cos[x],Sin[x]},{-Sin[x],Cos[x]}};
rotmat[x_] @{{a,b},{c,d}}] == Det[{{a,b},{c,d}}]
Inactive[Det][matrix
// matrix
rotmat[Pi] /4] // matrix rotmat[Pi
@rotmat[Pi]] == matrix /@ SingularValueDecomposition[rotmat[Pi]] SVD[matrix
- Notice how the middle matrix of the SVD is a diagonal matrix and when you multiply the diagonal you get the determinant.