Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c55fb9c
Update mathgen.py
Riei-Joaquim Oct 19, 2020
fab946e
Create determinantToMatrix22.cpp
Riei-Joaquim Oct 19, 2020
2bb6fe9
Update __init__.py
Riei-Joaquim Oct 19, 2020
bd6bea9
Update mathgen.py
Riei-Joaquim Oct 19, 2020
1e252fe
Added function for area of Sector
Souvikdeb2612 Oct 19, 2020
587f786
Update __init__.py
Souvikdeb2612 Oct 19, 2020
20b93b9
Update mathgen.py
Souvikdeb2612 Oct 19, 2020
94e35c2
Update sectorAreaFunc.py
Souvikdeb2612 Oct 19, 2020
d33de18
Created mean and median functions
Souvikdeb2612 Oct 19, 2020
5e18c82
Update __init__.py
Souvikdeb2612 Oct 19, 2020
f8cc8b3
Update mathgen.py
Souvikdeb2612 Oct 19, 2020
0158939
Merge branch 'master' into master
lukew3 Oct 19, 2020
382f32e
Merge pull request #229 from Souvikdeb2612/master
lukew3 Oct 19, 2020
2ea04c4
Merge branch 'master' into patch-3
lukew3 Oct 19, 2020
31e4150
Merge pull request #225 from Riei-Joaquim/patch-3
lukew3 Oct 19, 2020
29ae868
Merge pull request #224 from Riei-Joaquim/patch-4
lukew3 Oct 19, 2020
f723fb1
Fix build issues
lukew3 Oct 19, 2020
6d66bf5
Update mathgen.py
helplessThor Oct 19, 2020
65a56b6
Create deciToHexaFunc.py
helplessThor Oct 19, 2020
649bccd
Update __init__.py
helplessThor Oct 19, 2020
6c0486c
Merge branch 'master' into helplessThor-compound-1
lukew3 Oct 19, 2020
6c6dc19
Merge pull request #245 from helplessThor/helplessThor-compound-1
lukew3 Oct 19, 2020
90c4c43
Update mathgen.py
helplessThor Oct 19, 2020
7d1a1a2
Merge branch 'master' into helplessThor-deci-hex
lukew3 Oct 19, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mathgenerator/funcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@
from .vectorDotFunc import *
from .binary2sComplement import *
from .matrixInversion import *
from .binaryToHexaFunction import *
from .sectorAreaFunc import*
from .meanMedianFunc import*
from .determinantToMatrix22 import *
from .deciToHexaFunc import *
10 changes: 10 additions & 0 deletions mathgenerator/funcs/deciToHexaFunc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .__init__ import *


def deciToHexaFunc(max_dec=1000):
a = random.randint(0, max_dec)
b = hex(a)
problem = "Binary of " + str(a) + "="
solution = str(b)

return problem, solution
12 changes: 12 additions & 0 deletions mathgenerator/funcs/determinantToMatrix22.py
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions mathgenerator/funcs/meanMedianFunc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from .__init__ import *

def meanMedianFunc(maxlen = 10):
randomlist = random.sample(range(1, 99), maxlen)
total = 0
for n in randomlist:
total = total + n
mean = total/10
problem = f"Given the series of numbers {randomlist}. find the arithmatic mean and mdian of the series"
randomlist.sort()
median = (randomlist[4]+randomlist[5])/2
solution = f"Arithmetic mean of the series is {mean} and Arithmetic median of this series is {median}"
return problem, solution
10 changes: 10 additions & 0 deletions mathgenerator/funcs/sectorAreaFunc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from .__init__ import *

def sectorAreaFunc(maxRadius = 49,maxAngle = 359):
Radius = random.randint(1, maxRadius)
Angle = random.randint(1, maxAngle)
problem = f"Given radius, {Radius} and angle, {Angle}. Find the area of the sector."
secArea = float((Angle / 360) * math.pi*Radius*Radius)
formatted_float = "{:.5f}".format(secArea)
solution = f"Area of sector = {formatted_float}"
return problem, solution
7 changes: 6 additions & 1 deletion mathgenerator/mathgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,9 @@ def getGenList():
absoluteDifference=Generator("Absolute difference between two numbers", 71, "Absolute difference betweeen two numbers a and b =", "|a-b|", absoluteDifferenceFunc)
vectorDot = Generator("Dot Product of 2 Vectors", 72, "a . b = ", "c", vectorDotFunc)
binary2sComplement = Generator("Binary 2's Complement", 73, "2's complement of 11010110 =", "101010", binary2sComplementFunc)
invertmatrix = Generator("Inverse of a Matrix", 74, "Inverse of a matrix A is", "A^(-1)", matrixInversion)
invertmatrix = Generator("Inverse of a Matrix", 74, "Inverse of a matrix A is", "A^(-1)", matrixInversion)
sectorArea=Generator("Area of a Sector", 75,"Area of a sector with radius, r and angle, a ","Area",sectorAreaFunc)
meanMedian=Generator("Mean and Median", 76,"Mean and median of given set of numbers","Mean, Median",meanMedianFunc)
intMatrix22determinant = Generator("Determinant to 2x2 Matrix", 77, "Det([[a,b],[c,d]]) =", " a * d - b * c", determinantToMatrix22)
compoundInterest = Generator("Compound Interest", 78, "Compound interest for a principle amount of p dollars, r% rate of interest and for a time period of t years with n times compounded annually is = ", "A dollars", compoundInterestFunc)
decimalToHexadeci = Generator("Decimal to Hexadecimal", 79,"Binary of a=", "b", deciToHexaFunc)
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
license='MIT',
packages=find_packages(),
install_requires=[

],
entry_points={
}
Expand Down