;----------------------------------------------------------------- ; xprod.pro ; ; written by Andreas Reigber ;------------------------------------------------------------------ ; calculates the vector product between two (3x1) vectors ;------------------------------------------------------------------ ; This software has been released under the terms of the GNU Public ; license. See http://www.gnu.org/copyleft/gpl.html for details. ;------------------------------------------------------------------ function xprod,vek1,vek2 if n_elements(vek1) ne 3 then begin Print,"vek1 is not a nice vektor" Return,-1 endif if n_elements(vek2) ne 3 then begin Print,"vek2 is not a nice vektor" Return,-1 endif kreuz=vek1 kreuz[0]=vek1[1]*vek2[2]-vek1[2]*vek2[1] kreuz[1]=vek1[2]*vek2[0]-vek1[0]*vek2[2] kreuz[2]=vek1[0]*vek2[1]-vek1[1]*vek2[0] return,kreuz end