## Linear Algebra Reduced Row Echelon Form and Determinant Calculator

##### Feb 24, 2020

To reinforce the concepts I am learning in my linear algebra class, I made this calculator to give you the reduced row echelon form of a matrix and tell you the determinant. This was lot of fun to make and really made me think about topics from the class. For row reduction, it uses the general algorithm found here https://rosettacode.org/wiki/Reduced_row_echelon_form. The algorithm scans each row and divides the row by the value of the leading entry until the leading entry is a 1 and swaps rows to get a pivot in each row. The determinant is found by taking the product of the diagonals of the reduced row echelon form of the matrix multiplied by any scalars used to get to the reduced form. The sign of the determinant will be negative if the number of row interchanges performed is odd. We can only find the determinant of square matrices, meaning the number of rows is equal to the number of columns.

I also had to learn about floating point arithmetic errors in javascript. For example, 3*1.1 results in 3.3000000000000003 and the solution I found is to use this

```parseFloat(x.toPrecision(12));
```

This results in 3.300000000000

# Reduced Row Echelon Form (RREF) Calculator

Choose the dimension of the matrix: x

Enter the elements of the matrix