mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
added latex unavailable message and scripts folder
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user