Could I get help with some math?


#1

I have these Cross and Dot Product functions, but I am terrible at math and algebra and cant tell if they are right or not LOL

Note that in the project I will use these functions, I dont have access to Vector from mathutils or any linar algebra package, I have to do it myself.

Pls Heelp :sweat_smile:

def dot_product(a, b):
    return a.x * b.x + a.y * b.y + a.z * b.z

def cross_product(a, b):
    o = vec()
    o.x = a.y * b.z - a.z * b.y
    o.y = a.z * b.x - a.x * b.z
    o.z = a.x * b.y - a.y * b.x
    return o

#2

seems ok? Alternative python implementation available here