mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
added vector dot product
This commit is contained in:
@@ -71,3 +71,4 @@ from .multiplyComplexNumbersFunc import *
|
|||||||
from .geomProgrFunc import *
|
from .geomProgrFunc import *
|
||||||
from .geometricMeanFunc import *
|
from .geometricMeanFunc import *
|
||||||
from .harmonicMeanFunc import *
|
from .harmonicMeanFunc import *
|
||||||
|
from .vectorDotFunc import *
|
||||||
|
|||||||
13
mathgenerator/funcs/vectorDotFunc.py
Normal file
13
mathgenerator/funcs/vectorDotFunc.py
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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
|
||||||
@@ -156,3 +156,4 @@ complexNumMultiply = Generator("Multiplication of 2 complex numbers", 64, "(x +
|
|||||||
geometricprogression=Generator("Geometric Progression", 65, "Initial value,Common Ratio,nth Term,Sum till nth term =", "a,r,ar^n-1,sum(ar^n-1", geomProgrFunc)
|
geometricprogression=Generator("Geometric Progression", 65, "Initial value,Common Ratio,nth Term,Sum till nth term =", "a,r,ar^n-1,sum(ar^n-1", geomProgrFunc)
|
||||||
geometricMean=Generator("Geometric Mean of N Numbers",66,"Geometric mean of n numbers A1 , A2 , ... , An = ","(A1*A2*...An)^(1/n) = ans",geometricMeanFunc)
|
geometricMean=Generator("Geometric Mean of N Numbers",66,"Geometric mean of n numbers A1 , A2 , ... , An = ","(A1*A2*...An)^(1/n) = ans",geometricMeanFunc)
|
||||||
harmonicMean=Generator("Harmonic Mean of N Numbers",67,"Harmonic mean of n numbers A1 , A2 , ... , An = "," n/((1/A1) + (1/A2) + ... + (1/An)) = ans",harmonicMeanFunc)
|
harmonicMean=Generator("Harmonic Mean of N Numbers",67,"Harmonic mean of n numbers A1 , A2 , ... , An = "," n/((1/A1) + (1/A2) + ... + (1/An)) = ans",harmonicMeanFunc)
|
||||||
|
vectorDot = Generator("Dot Product of 2 Vectors",68, "a . b = ", "c", vectorDotFunc)
|
||||||
|
|||||||
Reference in New Issue
Block a user