matrix.py

Created by vnap0v

Created on July 30, 2025

3.27 KB

matrix

This script defines two functions, they can be used to solve a

  • linear system of 2 equations with 2 variables
  • linear system of 3 equations with 3 variables

of the form

A.x = b

The functions are:

solve_system_2(A, b)
solve_system_3(A, b) A is 2x2 or 3x3 matrix containing the coefficients

b is a 2 or 3 element vector containing the constants

The matrix and vector are processed as Python lists

example:

A=[[6, -5],
   [-7, 2]]
b=[2, -3]


During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.