Here you can find the source of cross(double[] vec1, double[] vec2, double[] outvec)
public static void cross(double[] vec1, double[] vec2, double[] outvec)
//package com.java2s; //License from project: Apache License public class Main { public static void cross(double[] vec1, double[] vec2, double[] outvec) { outvec[0] = vec1[1] * vec2[2] - vec1[2] * vec2[1]; outvec[1] = vec1[2] * vec2[0] - vec1[0] * vec2[2]; outvec[2] = vec1[0] * vec2[1] - vec1[1] * vec2[0]; }//from w w w . ja v a 2 s . com }