How can I calculate the cross product of two vectors without the use of programming libraries?
E.g given vectors a = (1, 2, 3) and b = (4, 5, 6)
a = (1, 2, 3)
b = (4, 5, 6)
for multiple dimensions, this might work;
def crossProd(a,b): dimension = len(a) c = [] for i in range(dimension): c.append(0) for j in range(dimension): if j <> i: for k in range(dimension): if k <> i: if k > j: c[i] += a[j]*b[k] elif k < j: c[i] -= a[j]*b[k] return c