You know how you can write “5+5+5-4-4-4” as “35-34”, and then use it for weird shortcuts like “3*(5-4)”? Well, matrices make for relatively easy handling of certain systems of equations, letting you fiddle with the whole system at once instead of restating equations one by one.
- 0 Posts
- 2 Comments
Joined 2 years ago
Cake day: June 14th, 2023
You are not logged in. If you use a Fediverse account that is able to follow users, you can follow this user.
Essentially.
A straightforward example would be an equation system: 2x+4y=10, 3x+5y=13. You could solve it manually, or you could call Cramer’s rule and plug the numbers into the formula:
Ax+By=C
Dx+Ey=F
x=[CB/FE]/[AB/DE] = (CE-BF)/(AE-BD)=(10*5-4*13) / (2*5 - 3*4) = (50-52)/(10-12)=1,
y=[AC/DF]/[AB/DE]=AF-CD / AE-BD = -4/-2=2
Pure algo, no thinking required. Also note that you don’t strictly need x to get y and vice versa.
In a more complex example: You’re making a program to draw something in 2D. You could implement mirroring, rotation, scaling etc…, or, you could declare each point (xy) a vector V=[X Y], implement matrices, and then V times [1 0/0 1] gives you V, [-1 0/0 1] gives you V mirrored on the Y axis, [1 0/0 -1] mirrors on the X axis, [j 0/0 j] scales it by j, [cosw -sinw/sinw cosw] rotates it by w… Makes life much easier.