Here you can find the source of cross(final double[] a, final double[] b, final double[] c)
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
public static void cross(final double[] a, final double[] b, final double[] c)
//package com.java2s; public class Main { /**/* w w w. j a v a 2s .co m*/ * compute cross product, set c = a ^ b. * * Dimensions of a, b, and c must equal 3. * * @param a * @param b */ public static void cross(final double[] a, final double[] b, final double[] c) { c[0] = a[1] * b[2] - a[2] * b[1]; c[1] = a[2] * b[0] - a[0] * b[2]; c[2] = a[0] * b[1] - a[1] * b[0]; } }