mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 14:35:23 +01:00
@@ -74,3 +74,4 @@ from .harmonicMeanFunc import *
|
||||
from .euclidianNormFunc import *
|
||||
from .angleBtwVectorsFunc import *
|
||||
from .absoluteDifferenceFunc import *
|
||||
from .vectorDotFunc import *
|
||||
|
||||
11
mathgenerator/funcs/vectorDotFunc.py
Normal file
11
mathgenerator/funcs/vectorDotFunc.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from .__init__ import *
|
||||
|
||||
|
||||
def vectorDotFunc(minVal=-20, maxVal=20):
|
||||
a = [random.randint(minVal, maxVal) for i in range(3)]
|
||||
b = [random.randint(minVal, maxVal) for i in range(3)]
|
||||
c = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]
|
||||
|
||||
problem = str(a) + " . " + str(b) + " = "
|
||||
solution = str(c)
|
||||
return problem, solution
|
||||
@@ -159,3 +159,4 @@ harmonicMean=Generator("Harmonic Mean of N Numbers",68,"Harmonic mean of n numbe
|
||||
eucldianNorm=Generator("Euclidian norm or L2 norm of a vector", 69, "Euclidian Norm of a vector V:[v1, v2, ......., vn]", "sqrt(v1^2 + v2^2 ........ +vn^2)", euclidianNormFunc)
|
||||
angleBtwVectors=Generator("Angle between 2 vectors", 70, "Angle Between 2 vectors V1=[v11, v12, ..., v1n] and V2=[v21, v22, ....., v2n]", "V1.V2 / (euclidNorm(V1)*euclidNorm(V2))", angleBtwVectorsFunc)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user