mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
Merge pull request #224 from Riei-Joaquim/patch-4
Create determinantToMatrix22 function
This commit is contained in:
12
mathgenerator/funcs/determinantToMatrix22.cpp
Normal file
12
mathgenerator/funcs/determinantToMatrix22.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
from .__init__ import *
|
||||
|
||||
def determinantToMatrix22(maxMatrixVal = 100):
|
||||
a = random.randint(0, maxMatrixVal)
|
||||
b = random.randint(0, maxMatrixVal)
|
||||
c = random.randint(0, maxMatrixVal)
|
||||
d = random.randint(0, maxMatrixVal)
|
||||
|
||||
determinant = a*d - b*c
|
||||
problem = f"Det([[{a}, {b}], [{c}, {d}]]) = "
|
||||
solution = f" {determinant}"
|
||||
return problem, solution
|
||||
Reference in New Issue
Block a user