Functions | |
void | Compute_Cross_Product (const HC_POINT *vector1, const HC_POINT *vector2, HC_POINT *out_vector) |
void | DCompute_Cross_Product (const HC_DVECTOR *vector1, const HC_DVECTOR *vector2, HC_DVECTOR *out_vector) |
void Compute_Cross_Product | ( | const HC_POINT * | vector1, | |
const HC_POINT * | vector2, | |||
HC_POINT * | out_vector | |||
) |
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 |
| 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.
void DCompute_Cross_Product | ( | const HC_DVECTOR * | vector1, | |
const HC_DVECTOR * | vector2, | |||
HC_DVECTOR * | out_vector | |||
) |
Similar to Compute_Cross_Product, but operates on double-precision data.
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 |