GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - longcrawfish/rref-calculator: RREF Calculator - Reduced Row Echelon Form Solver

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
examples
examples
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

RREF Calculator - Reduced Row Echelon Form Solver

A free and open-source RREF Calculator that converts matrices into reduced row echelon form using Gauss-Jordan elimination.

It provides step-by-step row operations to help students understand matrix reduction instead of only showing the final answer.

Live demo: https://rref-calculator.org

Features

  • Compute Reduced Row Echelon Form (RREF)
  • Generate step-by-step row operations
  • Use exact fraction arithmetic through mathjs
  • Accept integers, decimals, fractions, and blank values
  • Format matrices as plain text or LaTeX
  • Encode and parse shareable matrix solve slugs
  • Work with ordinary matrices and augmented matrices

Install

npm install rref-calculator

Usage

import { formatMatrixPlain, formatStepPlain, rref } from 'rref-calculator';

const result = rref([
  [1, 2, 5],
  [3, 4, 7],
]);

for (const [index, step] of result.steps.entries()) {
  console.log(`Step ${index}: ${formatStepPlain(step)}`);
  console.log(formatMatrixPlain(step.matrix));
}

console.log('Final RREF:');
console.log(formatMatrixPlain(result.rref));

Output:

Final RREF:
[1  0  -3]
[0  1  4]

API

rref(matrix)

Computes the reduced row echelon form of a matrix.

const result = rref([
  ['1/2', '1/3'],
  ['1/4', '1/6'],
]);

Returns:

type RrefResult = {
  input: FractionMatrix;
  rref: FractionMatrix;
  steps: RrefStep[];
  rank: number;
  pivotColumns: number[];
};

Step objects are structured so applications can render them as English text, localized UI labels, LaTeX, or custom educational explanations.

type RrefStep =
  | { type: 'initial'; matrix: FractionMatrix }
  | { type: 'swap'; rowA: number; rowB: number; matrix: FractionMatrix }
  | { type: 'scale'; row: number; factor: FractionValue; matrix: FractionMatrix }
  | {
      type: 'eliminate';
      targetRow: number;
      pivotRow: number;
      factor: FractionValue;
      matrix: FractionMatrix;
    };

Formatting Helpers

formatFraction(value);
formatFractionLatex(value);
formatMatrixPlain(matrix);
formatMatrixLatex(matrix);
formatStepPlain(step);
formatStepLatex(step);

Solve Slug Helpers

buildSolveSlug(rows, cols, values);
parseSolveSlug(slug);
normalizeMatrixValue(value);
encodeSolveValue(value);

Example:

buildSolveSlug(2, 2, ['1/2', '2', '0', '2']);
// 2x2-1~2_2_0_2

Input Values

Supported values include:

5
-2
1.25
-0.5
3/4
-7/9

Blank values are treated as 0.

Development

npm install
npm test
npm run build

License

MIT

About

RREF Calculator - Reduced Row Echelon Form Solver

rref-calculator.org

Topics

calculatoreducationgauss-jordanjavascriptlinear-algebramathmatrixmatrix-calculatorrrefrref-calculatortypescript

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.