multrix/README.md

67 lines
1.6 KiB
Markdown
Raw Permalink Normal View History

2022-11-18 08:10:36 -05:00
# Multrix
2022-11-13 20:42:28 -05:00
2023-01-16 16:43:28 -05:00
Matrix multiplication calculator; calculates the cross & dot products of matrices and vectors.
## Usage
The `multrix` command can calculate both dot or cross products if given the respective command line argument. If no valid commandline argument is given the program will ask which type of calculation should be made.
## installation
2024-01-31 12:56:18 -05:00
To install using nimble:
```sh
nimble install https://git.inamatrix.xyz/array-in-a-matrix/multrix
```
To install using pacman:
```sh
git clone https://git.inamatrix.xyz/array-in-a-matrix/multrix
cd multrix
makepkg si
```
2023-01-17 16:57:41 -05:00
## Math
### Dot Product
2023-01-17 17:13:01 -05:00
$$
2023-01-17 16:57:41 -05:00
\begin{align*}
A \cdot B =
\begin{bmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{1n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn} \\
\end{bmatrix}
\cdot
\begin{bmatrix}
b_{11} & b_{12} & \cdots & b_{1p} \\
b_{21} & b_{22} & \cdots & b_{1p} \\
\vdots & \vdots & \ddots & \vdots \\
b_{n1} & b_{n2} & \cdots & b_{np} \\
\end{bmatrix}
=
\begin{bmatrix}
a_{11}b_{11} + \cdots + a_{1n}b_{n1} & a_{11}b_{12} + \cdots + a_{1n}b_{n2} & \cdots & a_{11}b_{1p} + \cdots + a_{1n}b_{np} \\
a_{21}b_{11} + \cdots + a_{2n}b_{n1} & a_{21}b_{12} + \cdots + a_{2n}b_{n2} & \cdots & a_{21}b_{1p} + \cdots + a_{2n}b_{np} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1}b_{11} + \cdots + a_{mn}b_{n1} & a_{m1}b_{12} + \cdots + a_{mn}b_{n2} & \cdots & a_{m1}b_{1p} + \cdots + a_{mn}b_{np} \\
\end{bmatrix}
\end{align*}
2023-01-17 17:13:01 -05:00
$$
2023-01-17 16:57:41 -05:00
2023-01-17 17:06:46 -05:00
### Cross Product
2023-01-17 16:57:41 -05:00
2023-01-17 17:13:01 -05:00
$$
2023-01-17 16:57:41 -05:00
\begin{align*}
2023-08-15 22:28:51 -04:00
\vec{A} \times \vec{B} =
2023-01-17 16:57:41 -05:00
\begin{vmatrix}
i & j & k\\
a_1 & a_2 & a_3\\
b_1 & b_2 & b_3
\end{vmatrix} = (a_2b_3-a_3b_2)i + (a_3b_1-a_1b_3)j+(a_1b_2-a_2b_1)k
\end{align*}
2023-01-17 17:13:01 -05:00
$$