Any math gurus out there? It’s been a while since Calculus/Trig and even longer since Algebra. Since I deal with vectors all the time in Unreal, I thought it’d be a good idea to spend a day doing some by hand. In doing so I realized two things: The way I think about vector multiplication in Unreal and the way Unreal handles vector multiplication differs from how it’s handled in physics or other math. This got me thinking, are we doing them wrong?
According to Linear Algebra, there are only two ways to multiply vectors: Dot Product and Cross Product. This of course is excluding things like float x vector or getting length/magnitude.
The Dot Product multiplies two vectors and adds the coordinates together to get a single float value.
A = (x, y, z)
B = (x, y, z)
C = (Ax * Bx + Ay * By + Az + Bz)
The Cross Product converts two vectors into matricides and finds the determinant of each coordinate group to produce a new vector.
A = (x, y, z)
B = (x, y, z)
C =
[x Ax Bx]
[y Ay By]
[z Az Bz]
which is…
x =
[Ay Az]
[By Bz]
(minus)
y =
[Ax Az]
[Bx Bz]
(plus)
z =
[Ax Ay]
[Bx By]
Both the Dot Product and Cross Product are optional in Unreal, but natively it simply multiplies the coordinate pairs together to produce a new vector like so:
A = (x, y, z)
B = (x, y, z)
C = (Ax * Bx, Ay * By, Az * Bz)
This is basically ordered pairs, which makes sense because a 3D environment is just a graph. Now, I can get pretty much anything I want from this: the distance between two vectors or the angle, etc, and I don’t have to do any trig.
I suppose the question is why does this still work and is it technically wrong? Or are Unreal vectors not really vectors?