Here you can find the source of cross(double[] p, double[] q)
private static double[] cross(double[] p, double[] q)
//package com.java2s; //License from project: Open Source License public class Main { private static double[] cross(double[] p, double[] q) { return new double[] { p[1] * q[2] - p[2] * q[1], p[2] * q[0] - p[0] * q[2], p[0] * q[1] - p[1] * q[0] }; }//from www .j a v a2 s. c om }