mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
⬜⬜ whitespace ⬜⬜
This commit is contained in:
2
Makefile
2
Makefile
@@ -2,7 +2,7 @@ IGNORE_ERRORS = E501,F401,F403,F405
|
|||||||
PKG = mathgenerator
|
PKG = mathgenerator
|
||||||
|
|
||||||
format:
|
format:
|
||||||
python -m autopep8 --ignore=$(IGNORE_ERRORS) -i $(PKG)/*
|
python -m autopep8 --ignore=$(IGNORE_ERRORS) -ir $(PKG)/*
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
python -m flake8 --ignore=$(IGNORE_ERRORS) $(PKG)
|
python -m flake8 --ignore=$(IGNORE_ERRORS) $(PKG)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ from .__init__ import *
|
|||||||
|
|
||||||
def angleBtwVectorsFunc(maxEltAmt=20):
|
def angleBtwVectorsFunc(maxEltAmt=20):
|
||||||
s = 0
|
s = 0
|
||||||
v1 = [random.uniform(0, 1000) for i in range(random.randint(2,maxEltAmt))]
|
v1 = [random.uniform(0, 1000) for i in range(random.randint(2, maxEltAmt))]
|
||||||
v2 = [random.uniform(0, 1000) for i in v1]
|
v2 = [random.uniform(0, 1000) for i in v1]
|
||||||
for i in v1:
|
for i in v1:
|
||||||
for j in v2:
|
for j in v2:
|
||||||
@@ -14,7 +14,7 @@ def angleBtwVectorsFunc(maxEltAmt=20):
|
|||||||
solution = ''
|
solution = ''
|
||||||
try:
|
try:
|
||||||
solution = str(math.acos(s / mags))
|
solution = str(math.acos(s / mags))
|
||||||
except:
|
except MathDomainError:
|
||||||
print('angleBtwVectorsFunc has some issues with math module, line 16')
|
print('angleBtwVectorsFunc has some issues with math module, line 16')
|
||||||
solution = 'NaN'
|
solution = 'NaN'
|
||||||
# would return the answer in radians
|
# would return the answer in radians
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ from .__init__ import *
|
|||||||
|
|
||||||
|
|
||||||
def euclidianNormFunc(maxEltAmt=20):
|
def euclidianNormFunc(maxEltAmt=20):
|
||||||
vec = [random.uniform(0, 1000) for i in range(random.randint(2,maxEltAmt))]
|
vec = [random.uniform(0, 1000) for i in range(random.randint(2, maxEltAmt))]
|
||||||
problem = f"Euclidian norm or L2 norm of the vector{vec} is:"
|
problem = f"Euclidian norm or L2 norm of the vector{vec} is:"
|
||||||
solution = math.sqrt(sum([i**2 for i in vec]))
|
solution = math.sqrt(sum([i**2 for i in vec]))
|
||||||
return problem, solution
|
return problem, solution
|
||||||
|
|||||||
Reference in New Issue
Block a user