Function to find cross product of two vector array .
function crossproduct ( $ vect_A , $ vect_B , $ cross_P ) { $ cross_P [ 0 ] = $ vect_A [ 1 ] * $ vect_B [ 2 ] - $ vect_A [ 2 ] * $ vect_B [ 1 ] ; $ cross_P [ 1 ] = $ vect_A [ 2 ] * $ vect_B [ 0 ] - $ vect_A [ 0 ] * $ vect_B [ 2 ] ; $ cross_P [ 2 ] = $ vect_A [ 0 ] * $ vect_B [ 1 ] - $ vect_A [ 1 ] * $ vect_B [ 0 ] ; return $ cross_P ; }