notes

Log | Files | Refs

cross_product.txt (5789B)


      1 ===============================================================================
      2 CROSS PRODUCT
      3 ===============================================================================
      4 
      5 The cross product is an operation that takes two vectors in R^3 and returns
      6 another vector in R^3, written a x b. Unlike the dot product, the result is a
      7 vector, not a scalar. The cross product is only defined in three dimensions
      8 (and in a generalized sense in seven dimensions; here we restrict to R^3).
      9 
     10 
     11 -------------------------------------------------------------------------------
     12 1. GEOMETRIC MEANING
     13 -------------------------------------------------------------------------------
     14 
     15 Direction:
     16   a x b is perpendicular to both a and b, following the right-hand rule: if you
     17   point your fingers along a and curl them toward b, your thumb points in the
     18   direction of a x b.
     19 
     20 Magnitude:
     21   ||a x b|| = ||a|| * ||b|| * sin(theta)
     22 
     23   where theta is the angle between a and b. The length equals the area of the
     24   parallelogram spanned by a and b.
     25 
     26 
     27 -------------------------------------------------------------------------------
     28 2. ALGEBRAIC DEFINITION
     29 -------------------------------------------------------------------------------
     30 
     31 For vectors:
     32 
     33        | a1 |         | b1 |
     34   a =  | a2 |    b =  | b2 |
     35        | a3 |         | b3 |
     36 
     37 the cross product is:
     38 
     39           | a2*b3 - a3*b2 |
     40   a x b = | a3*b1 - a1*b3 |
     41           | a1*b2 - a2*b1 |
     42 
     43 This can be remembered using the determinant of a formal 3x3 matrix:
     44 
     45   | e1  e2  e3 |
     46   | a1  a2  a3 |  =  e1*(a2*b3 - a3*b2)
     47   | b1  b2  b3 |     - e2*(a1*b3 - a3*b1)
     48                      + e3*(a1*b2 - a2*b1)
     49 
     50 where e1, e2, e3 are the standard unit vectors in R^3.
     51 
     52 
     53 -------------------------------------------------------------------------------
     54 3. THE "CROSS-OUT" METHOD (FASTEST)
     55 -------------------------------------------------------------------------------
     56 
     57 1. Stack them: write the components of the first vector over the second twice.
     58 
     59 2. Cross out the first and last columns.
     60 
     61 3. Multiply in an X pattern (top-left * bottom-right minus top-right *
     62    bottom-left) for each remaining pair:
     63 
     64     a1  a2  a3  a1  a2  a3
     65           \/  \/  \/
     66           /\  /\  /\
     67     b1  b2  b3  b1  b2  b3
     68 
     69     or:
     70 
     71     a1  b1 
     72     a2  b2
     73       \/
     74       /\
     75     a3  b3
     76       \/
     77       /\
     78     a1  b1
     79       \/
     80       /\
     81     a2  b2
     82     a3  b3
     83 
     84 Result:
     85 
     86           | a2*b3 - a3*b2 |
     87   a x b = | a3*b1 - a1*b3 |
     88           | a1*b2 - a2*b1 |
     89 
     90 
     91 -------------------------------------------------------------------------------
     92 4. RULES OF CALCULATION (WITH EXAMPLES)
     93 -------------------------------------------------------------------------------
     94 
     95 Let a, b, c in R^3 and lambda in R.
     96 
     97 
     98 4.1 Anticommutativity
     99 
    100 Swapping the order flips the sign:
    101 
    102   a x b = -(b x a)
    103 
    104 Example:
    105 
    106   | 1 |   | 0 |       | 0 |
    107   | 0 | x | 1 |   =   | 0 |
    108   | 0 |   | 0 |       | 1 |
    109 
    110   | 0 |   | 1 |       |  0 |
    111   | 1 | x | 0 |   =   |  0 |
    112   | 0 |   | 0 |       | -1 |
    113 
    114 
    115 4.2 Distributivity over addition
    116 
    117   a x (b + c) = a x b + a x c
    118   (a + b) x c = a x c + b x c
    119 
    120 Example (second component of a x (b + c)):
    121 
    122        | 1 |       | 0 |       | 1 |
    123   a =  | 2 |  b =  | 1 |  c =  | 0 |
    124        | 0 |       | 1 |       | 1 |
    125 
    126   b + c = | 1 |
    127           | 1 |
    128           | 2 |
    129 
    130   a x b = |  2 |    a x c = |  2 |
    131           | -1 |            | -1 |
    132           |  1 |            | -2 |
    133 
    134   a x b + a x c = |  4 |
    135                   | -2 |
    136                   | -1 |
    137 
    138   a x (b + c) = | 2*2 - 0*1 |   |  4 |
    139                 | 0*1 - 1*2 | = | -2 |
    140                 | 1*1 - 2*1 |   | -1 |
    141 
    142 
    143 4.3 Scalar multiplication (homogeneity)
    144 
    145 A scalar can be factored out of either slot:
    146 
    147   (lambda*a) x b = a x (lambda*b) = lambda * (a x b)
    148 
    149 Example: a = | 1 |, b = | 0 |, lambda = 3
    150 
    151   (3*a) x b = | 3 |   | 0 |       | 0 |
    152               | 0 | x | 1 |   =   | 0 |
    153               | 0 |   | 0 |       | 3 |
    154 
    155             = 3 * | 0 | = 3 * (a x b)
    156                   | 0 |
    157                   | 1 |
    158 
    159 
    160 4.4 Cross product with the zero vector
    161 
    162   a x 0 = 0 x a = 0
    163 
    164 
    165 4.5 Parallel vectors
    166 
    167 a and b are parallel (or one is zero) if and only if:
    168 
    169   a x b = 0
    170 
    171 Example: a = | 2 |, b = | 1 | = (1/2)*a
    172 
    173              | 4 |       | 2 |
    174              | 6 |       | 3 |
    175 
    176   a x b = | 4*3 - 6*2 |   | 0 |
    177           | 6*1 - 2*3 | = | 0 |
    178           | 2*2 - 4*1 |   | 0 |
    179 
    180 
    181 4.6 Self-cross product
    182 
    183   a x a = 0
    184 
    185 (Special case of the parallel-vectors rule.)
    186 
    187 
    188 4.7 Jacobi identity
    189 
    190   a x (b x c) - b x (c x a) - c x (a x b) = 0
    191 
    192 
    193 4.8 Relation to dot product (vector triple product expansion)
    194 
    195   a x (b x c) = (a . c)*b - (a . b)*c
    196 
    197 Example: a = e1, b = e2, c = e3:
    198 
    199   a . c = 0,  a . b = 0
    200   =>  a x (b x c) = 0*b - 0*c = 0
    201 
    202   b x c = e1
    203   =>  e1 x e1 = 0
    204 
    205 
    206 4.9 Magnitude and angle
    207 
    208   ||a x b||^2 = ||a||^2 * ||b||^2 - (a . b)^2
    209 
    210 Equivalently:
    211 
    212   ||a x b|| = ||a|| * ||b|| * sin(theta)
    213 
    214 
    215 4.10 Relation to the dot product (scalar triple product)
    216 
    217   a . (b x c) = b . (c x a) = c . (a x b)
    218 
    219 This value is the (signed) volume of the parallelepiped spanned by a, b, c.
    220 
    221 Example:
    222 
    223   a = | 1 |  b = | 0 |  c = | 0 |
    224       | 0 |      | 1 |      | 0 |
    225       | 0 |      | 0 |      | 1 |
    226 
    227   b x c = | 1 |,   a . (b x c) = 1
    228           | 0 |
    229           | 0 |
    230 
    231 
    232 -------------------------------------------------------------------------------
    233 5. WORKED EXAMPLE
    234 -------------------------------------------------------------------------------
    235 
    236 Compute u x v for:
    237 
    238        |  2 |         |  1 |
    239   u =  | -1 |    v =  |  4 |
    240        |  3 |         | -2 |
    241 
    242   u x v = | (-1)*(-2) - 3*4 |   |  2 - 12 |   | -10 |
    243           | 3*1 - 2*(-2)    | = |  3 + 4  | = |   7 |
    244           | 2*4 - (-1)*1    |   |  8 + 1  |   |   9 |
    245 
    246 Check:
    247 
    248   u . (u x v) = 2*(-10) + (-1)*7 + 3*9 = -20 - 7 + 27 = 0
    249   v . (u x v) = 1*(-10) + 4*7 + (-2)*9 = -10 + 28 - 18 = 0
    250 
    251 So the result is perpendicular to both u and v.