variable X procuct - [(x,y) for x in list1 for y in list2]

Bengt Richter bokr at oz.net
Sun Jun 2 21:33:05 EDT 2002


On Fri, 31 May 2002 21:59:14 +1200, John La Rooy <larooy at xtar.co.nz> wrote:

>Perhaps the translation is correct, but the example you give is a cartesian product, not a cross product.
>From my algebra book...
>
>
>In many applications of vectors to problems in geometry, physics, and engineering it is of interest to construct a vecotr in 3-space that is perpendicular to two given vectors. In this section we introduce a type of vector multiplication the facilitates this construction
>
>
>DEFINITION: If u=(u1,u2,u3) and v=(v1,v2,v3) are vectors in 3-space, then the cross product 
>is the vector defined by
>u x v = (u2v3 - u3v2 , u3v1 - u1v3 , u1v2 - u2v1)

And if i,j,k are the unit vectors, you can also write this
as the determinant of the matrix

  i  j  k
  u1 u2 u3
  v1 v2 v3

(which is easier to remember for me).

The direction of the result is perpendicular to the plane that
includes u and v, in the direction a right-hand screw would move
if turned as u rotates into v (assuming a right hand coordinate
system). Easy to see with pure x and y axis vectors:

  i  j  k
  u1 0  0
  0  v2 0

=> k*(u1*v2)  (+ in the z direction of unit vector k)

vs the same vectors but turning the other way (v x u):

  i  j  k
  0  v2 0
  u1 0  0

=> -k*(v2*u1) (also along z axis but opposite direction)

thought I'd mention, in case someone hadn't seen this before ;-)

Regards,
Bengt Richter



More information about the Python-list mailing list