HC_Compute_Cross_Product
-
void
HC_Compute_Cross_Product(Vector const *vector1, Vector const *vector2, Vector *out_vector) - void HC_Compute_Cross_Product(Vector const vector1, Vector const vector2, Vector out_vector)
Computes the cross product of two vectors.
| i j k | | x1 y1 z1 | | x2 y2 z2 |
Where i, j, and k are the unit vectors along the X, Y, and Z axes, respectively. That works out to be equal to
i*(y1*z2 - z1*y2) - j*(x1*z2 - z1*x2) + k*(x1*y2 - y1*x2)
The result is always perpendicular to both inputs, and of length equal to the length(vector1) * length(vector2) * sin(angle between vector1 and vector2). The order of the inputs matters. Switching the inputs will reverse the result.
HC_Compute_Coordinates, HC_Compute_Dot_ProductParameters
vector1: input 3D vectors.
vector2: input 3D vectors.
out_vector: output 3D vector returned to the caller. Can point to the same place as vector1 or vector2