added latex unavailable message and scripts folder

This commit is contained in:
lukew3
2021-10-06 12:30:15 -04:00
parent b66a5bdec7
commit 7e7463e6a6
100 changed files with 384 additions and 21 deletions

View File

@@ -14,15 +14,23 @@ def angleBtwVectorsFunc(maxEltAmt=20, format='string'):
mags = math.sqrt(sum([i**2
for i in v1])) * math.sqrt(sum([i**2 for i in v2]))
problem = f"angle between the vectors {v1} and {v2} is:"
solution = ''
ans = 0
try:
solution = str(round(math.acos(s / mags), 2)) + " radians"
ans = round(math.acos(s / mags), 2)
solution = str(ans) + " radians"
except ValueError:
print('angleBtwVectorsFunc has some issues with math module, line 16')
solution = 'NaN'
ans = 'NaN'
# would return the answer in radians
return problem, solution
if format == 'string':
problem = f"angle between the vectors {v1} and {v2} is:"
return problem, solution
elif format == 'latex':
return "Latex unavailable"
else:
return v1, v2, ans
angle_btw_vectors = Generator("Angle between 2 vectors", 70,