Posts

Showing posts from April, 2021

Demystifying the Cross Product

Image
  I've written about the dot product before. It's simple in implementation, but maybe you weren't sure what it's practically used for. The cross product, on the other hand, has the added dimension of being complicated to compute. It would be pretty difficult for someone to determine the cross product in their head! So, before we get into what the cross product is used for, let's recall how we compute it. First, we need two vectors, let's call them a and b. When we compute the cross product between two vectors, we will end up with a resulting vector, we'll call that C. How do we get C? C = <a.y*b.z - a.z*by, a.z*b.x - a.x*b.z, a.x*b.y - a.y*bx> One way I like to remember this is - for every component in C, the other two components are used in the computation. For example, let's look at C.x. C.x = a.y * b.z - a.z * b.y Notice, this is for the 'x' component of C, and yet in the computation, only y and z components are used! Important note: ord...