mirror of
https://github.com/DeaDvey/mathgenerator.git
synced 2025-11-28 06:25:23 +01:00
Add Vector Cross Product
This commit is contained in:
@@ -387,6 +387,14 @@ def primeFactors(minVal=1, maxVal=200):
|
|||||||
solution = f"{factors}"
|
solution = f"{factors}"
|
||||||
return problem, solution
|
return problem, solution
|
||||||
|
|
||||||
|
def vectorCrossFunc(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[1]*b[2] - a[2]*b[1],
|
||||||
|
a[2]*b[0] - a[0]*b[2],
|
||||||
|
a[0]*b[1] - a[1]*b[0]]
|
||||||
|
return str(a) + " X " + str(b) + " = ", str(c)
|
||||||
|
|
||||||
# || Class Instances
|
# || Class Instances
|
||||||
|
|
||||||
#Format is:
|
#Format is:
|
||||||
@@ -419,4 +427,5 @@ systemOfEquations = Generator("Solve a System of Equations in R^2", 23, "2x + 5y
|
|||||||
distance2Point = Generator("Distance between 2 points", 24, "Find the distance between (x1,y1) and (x2,y2)","sqrt(distanceSquared)", distanceTwoPointsFunc)
|
distance2Point = Generator("Distance between 2 points", 24, "Find the distance between (x1,y1) and (x2,y2)","sqrt(distanceSquared)", distanceTwoPointsFunc)
|
||||||
pythagoreanTheorem = Generator("Pythagorean Theorem", 25, "The hypotenuse of a right triangle given the other two lengths a and b = ", "hypotenuse", pythagoreanTheoremFunc)
|
pythagoreanTheorem = Generator("Pythagorean Theorem", 25, "The hypotenuse of a right triangle given the other two lengths a and b = ", "hypotenuse", pythagoreanTheoremFunc)
|
||||||
linearEquations = Generator("Linear Equations", 26, "2x+5y=20 & 3x+6y=12", "x=-20 & y=12", linearEquationsFunc) #This has multiple variables whereas #23 has only x and y
|
linearEquations = Generator("Linear Equations", 26, "2x+5y=20 & 3x+6y=12", "x=-20 & y=12", linearEquationsFunc) #This has multiple variables whereas #23 has only x and y
|
||||||
primeFactors = Generator("Prime Factorisation", 27, "Prime Factors of a =", "[b, c, d, ...]", primeFactors)
|
primeFactors = Generator("Prime Factorisation", 27, "Prime Factors of a =", "[b, c, d, ...]", primeFactors)
|
||||||
|
vectorCross = Generator("Cross Product of 2 Vectors", 28, "a X b = ", "c", vectorCrossFunc)
|
||||||
|
|||||||
Reference in New Issue
Block a user